Add-ins.com home page
Questions? Call us 302-234-9857, 8AM to 10PM U.S. East Coast time 7 days a week
How to document your macro code
and why use the Code Documentor for Microsoft® Excel®

There are several key steps one can do to document macro code and to make it more understandable, both when you are first creating it and when you look at it again months later:

  • Add comment lines. Comments lines begin with a single quote:  'this is a comment
  • Change the background color of comment lines to light blue.  In the VB Editor, select Tools, Options, Editor Format and change there
  • Add documentation at key steps in the module and in a module at the front.  Typically we name the module "AAA-Documentation"
  • Use very long variable names
  • Use very long macro names
  • Use many small routines called by one routine versus one very long macro.  Pass variables back and forth
  • Use the Code Documentor developed by Rob Bovey to analyze and document your project
Product: Code Documentor     Customers who looked at this product also looked at:
For: Excel 97 to Excel 2007  

Macros Made Easy - A downloadable book (Windows help file format) on how to write macros for Microsoft Excel

Macro Examples - Get over 1200 macro examples for Microsoft Excel in a downloadable book (Windows help file format). These examples are new and not a repeat of the ones in Macros Made Easy.

Price: Free
Company: Application Professionals
Location: U.S.
Email support: Yes
Phone support: No

Memory usage: Code Documentor is a VBA add-in.  Such add-ins use less memory than COM add-ins and have 5-10 open at a time typically has little to no effect on Excel memory.  Use of the Add-In Information Lister to manage add-ins, removing those not needed and then re-installing when needed is best.

The Code Documentor provides a list of the sheets, userforms, and modules in your project, how many procedures (macros) in each, and how many lines of code.  It does not list the individual macro names or what variables are being used when calling them.  Nor does it list any of the comments found in the macros.  The key benefit is knowing if your lines of code in a module is exceeding 600 lines.  Code that is more than 600 lines has sometimes been know to become corrupt.  It is best to keep modules below 600 lines, and always below 1000 lines.

To use the Code Documentor after installing, open your workbook or add-in containing your code.  If the code is password protected, access the project so that the code is viewable.  Then, do the following:

  • For excel 200-2003, select Tools, Macro, Security.  the following dialog appears:

  • If you are using Excel 2007, select Office Button,  Excel Options, Trust Center, Trust Center Settings, Macros.  The following dialog appears:

To use the Code Documentor after installing :

  • Make a backup copy of your project.  This insures you can recover back to it in case use the Code Documentor causes a problem
  • From a Microsoft Excel worksheet, if Excel 2003-2010, select Tools, Document Project. If Excel 2007, click on the add-ins ribbon and click on one of the "Document Project" button (there is a bug in the Code Documentor that shows two buttons)
  • Select your project and click OK.  A documentation worksheet is created.

 

 

 

 
Quantity
Discount
2
10%
3
20%
4
30%
5-9
40%
10 or more
50%

Order online from our
secure service
Get delivery in minutes!

Order Risk Free
Money back guarantee
if not satisfied

Buy individually
or as part of the Productivity Suite
and save

  CSV File Creator
  Colored Cells
      Assistant
  Data Loader
  Duplicate Finder

  Lookup Assistant
  Macros Made Easy
  Macro Examples
  Password Assistant
  Spreadsheet
      Assistant
  Waterfall Chart
      Creator

Recently Viewed


Home * About * Contact * Feedback * Upgrades * Money Back Guarantee * FAQ's
Download Information * Ordering Questions * Support
Product List * New Products * Free Products * Trial Versions * Products by Others

Copyright 2011 Add-ins.com LLC, all rights reserved.  Spreadsheet Assistant is a registered trademark of Add-ins.com LLC.
Microsoft, Excel and the Office logo are trademarks or registered trademarks of Microsoft Corporation in the United States and/or other countries.