+ Reply to Thread
Results 1 to 5 of 5

Where put project code

  1. #1
    Forum Contributor
    Join Date
    02-13-2016
    Location
    CT USA
    MS-Off Ver
    office 365 subscription
    Posts
    178

    Where put project code

    CONTEXT
    The project i am working on has three fundamental tasks
    (1) I must manually enter data, that describes a house, into worksheets
    (2) I then run code that transcribes worksheet data into objects and collections that define a house
    (3) i then run code that applies National Electric Code (NEC) to the coded house to define an electrical design for that house

    MY QUESTION
    Sooo, being a novice, i am uncertain where to put my code. I sense that i do not want large hunks of code but many small
    modules of code that can be tested out individually. But where do i put all this code. I can imagine it is a lot of code. maybe too much
    to sift through within a single project manager?

    SOME OF MY THINKING ABOUT POSSIBLE SOLUTIONS
    Some thoughts that I explored (with ignorance) was to put the code that transcribes worksheet data into objects and collections in the
    workbook that has the worksheets. Then put the code that knows the NEC rules into a second workbook. Similar to the first workbook,
    the rules are transcribed into coded objects and collections.

    Finally, a workbook is created and holds the code for the design results. The code in this workbook applies the objects and collections
    of the above two workbooks and displays the results in this last third workbook.

    QUESTIONS THAT SURFACE WITH MY POSSIBLE SOLUTION
    If the above is a reasonable strategy...and i welcome hearing alternatives, then how does the code of one workbook talk to the code of
    the other workbooks? Maybe if they are all concurrently open the code is available to be run by the interpreter as long as all code is uniquely
    defined and hence present no conflict to the interpreter?

    How do you guys handle code location and the immense number of small modules of code for your large projects?

    Thank you....
    bil

  2. #2
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365, varying versions/builds
    Posts
    21,280

    Re: Where put project code

    I cannot see any reason to separate the code into three workbooks.
    Remember what the dormouse said
    Feed your head

  3. #3
    Forum Contributor
    Join Date
    02-25-2022
    Location
    Dallas, Texas
    MS-Off Ver
    Office 365
    Posts
    174

    Re: Where put project code

    I've worked on a few large engineering projects related to estimation power, performance and area of semiconductor devices.  Here is what I've learned:

    1. Do not mix code and data in the same workbook.  The requirements are always changing requiring code changes.  The data may also change.  It is a nightmare to update the code in a workbook that contains code.  I create an addin (.xlam) that contains all code and a workbook that contains user data.  I can easily update the addin without impacting the worksheet data. 

    2. Plan for user workbook data to change.  I was constantly adding new columns to add info to worksheets.  Rather than refer to specific columns I always used enums or dictionaries to get the column number.
    3.  Format all user data as a table.  Use database compatible names.  It is easier to extract data using SQL.

    4.  Use a database to store all engineering (NEC) data and other related info.  I used an Access database to store all engineering data.  You'll need to learn about databases and SQL but it makes your app more supportable.

    5.  Use an installer to distribute app.  I use Inno Setup (free).  It makes it easier to update.

  4. #4
    Forum Contributor
    Join Date
    02-13-2016
    Location
    CT USA
    MS-Off Ver
    office 365 subscription
    Posts
    178

    Re: Where put project code

    Thank you, Mogul!!!! Your advice really spoke to me.

  5. #5
    Forum Contributor
    Join Date
    02-13-2016
    Location
    CT USA
    MS-Off Ver
    office 365 subscription
    Posts
    178

    Re: Where put project code

    Thank you, rory, for your help.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. When I close another project without macros my macro project still runs its code
    By RossioPS in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-14-2017, 04:07 AM
  2. Replies: 3
    Last Post: 08-11-2017, 03:10 AM
  3. Replies: 1
    Last Post: 06-12-2017, 09:20 PM
  4. [SOLVED] hELP FOR MY PROJECT (IN PROJECT SHEET CODE NOT WORK,, OUTSIDE THAT CODE WORK)
    By santosh226001 in forum Excel Programming / VBA / Macros
    Replies: 16
    Last Post: 08-06-2013, 06:53 AM
  5. [SOLVED] Function that concatenates multiple sub-project descriptions based on project code
    By markbpi in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 11-28-2012, 06:49 PM
  6. Help w/VBA code for project.
    By iThinkDeeply in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 11-04-2010, 01:00 PM
  7. If i entered any project code in sheet2 display all data of that project
    By koolguys4u in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 06-21-2009, 03:09 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1