Main Dialog Box (Code Commenter and Error Handler)

This content is no longer actively maintained. It is provided as is, for anyone who may still be using these technologies, with no warranties or claims of accuracy with regard to the most recent product version or service release.

The VBA Code Commenter and Error Handler add-in can be used to create code that is more professional and easier to debug. The add-in uses a customizable template that inserts comments and error handling code in your code module.

To open the Code Commenter and Error Handler add-in, open the Visual Basic Editor (ALT + F11) from any Office application. If the Code Commenter and Error Handler tool is not listed in the Add-Ins menu, you must first load it, using the Add-In Manager located in the Add-Ins menu. When the tool is loaded, you can launch it from the Add-Ins menu. To load the Code Commenter and Error Handler add-in into the Add-In Manager, select the add-in, and then select the Loaded/Unloaded check box.

  • Template to apply
    Contains the path name of the template to be used.
  • Browse "…"
    Displays the Select Code Commenter or Error Handler Templates window, which makes it possible for you to select the template you wish to apply. On first use the Code Commenter template, Error Handler template, and the combined Code Commenter and Error Handler template are offered.
  • Insert
    Select the locations where you want to insert the template. The default setting of these options is dependent on the state of the project, as listed in the chart below:
    Project State Default Option Button
    No Code window open All Procedures in Current Project
    Code window open, but does not have focus All Procedures in Current Module
    Code window open, but no procedures in the window All Procedures in Current Module
    Cursor is inside a procedure All Procedures in Current Module
    Cursor is outside a procedure All Procedures in Current Module
    Selection of a single procedure, or part of a procedure All Procedures in Current Module
    Selection of multiple procedures, or parts of multiple procedures All Procedures in Current Module

Note   You can apply only one template to any procedure. If you attempt to apply a new template to a procedure that already uses one, or to a group of procedures that use different templates, the original template used for each individual procedure will be retained. However, procedures that do not already use a template will adopt the new template of your choice.

  • Edit
    Opens the currently selected template in the Template Editor.
  • New
    Opens the Template Editor with an empty edit box, making it possible for you to create your own template.
  • Author
    Makes it possible for you to type the name and initials of the author of the template procedure. After the first use, the name and initials are stored on the registry.
  • Apply
    Applies the chosen template and closes the add-in.

See Also

Code Commenter and Error Handler Template Formats | Select Code Commenter or Error Handler Templates Window (Code Commenter and Error Handler) | Template Editor (Code Commenter and Error Handler)