Skip to main content main content

Removing Auto-created Macros from Your Invoice Template

Microsoft Excel creates/records macros automatically when you double-click an ActiveX control, like a button or an image object, in design mode. The macros are usually empty - i.e. they don't contain any code.

This document was written for version 2 of Uniform Invoice Software, which was previously named Excel Invoice Manager. For the documents that are specific to Uniform Invoice Software, please download the help document, or install the program that already has the help document included.

Although Excel Invoice Manager itself does not use any macro, those auto-created macros could cause problems.

The Problem

If you save the auto-created macros with your invoice template, and then re-open the invoice template, Excel may display one of the following error messages, depending on the version of Excel you are running and the security level setting of your Excel. (All screenshots below are taken from Excel 2003).

Solution 1

To prevent Excel from creating macros automatically in design mode, try to click the controls (buttons, images etc.) slowly, so as to ensure that Excel does not think you are double-clicking the control.

To remove those auto-created macros from your invoice template, follow the steps below:

  1. Open the invoice template.
  2. Unprotect the Invoice worksheet. For information about how to do this in Excel, see Customizing the Invoice Template.
  3. Press ALT+F11 key on your keyboard. This opens the Microsoft Visual Basic macro editor of Excel.

    Macro editor
    Macro editor (Click to enlarge)

  4. Double-click a sheet name (say Invoice) in the Project pane. Excel displays the macros contained in the sheet in the right pane.
  5. Click the right pane to activate it.
  6. Press CTRL+A on your keyboard to select all the macros.
  7. Press DEL key on your keyboard to delete all the macros.
  8. Repeat step 4 - 7 for each worksheet in your template.
  9. Click menu File -> Save.
  10. Click menu File -> Close and Return to Microsoft Excel. This closes the macro editor and returns you to Excel.
  11. Protect the Invoice worksheet. For information about how to do this in Excel, see Customizing the Invoice Template.
  12. Exit Excel and re-open the invoice template. The security warning message disappears.

Solution 2

Should you like to start from scratch again, you can download the default (clean) template here:

Tip: The procedure described here works too for the free invoice template.