XL5: Custom Macro Command Duplicated on Tools Menu

Last reviewed: February 2, 1998
Article ID: Q124005
The information in this article applies to:
  • Microsoft Excel for Windows, versions 5.0, 5.0c
  • Microsoft Excel for the Macintosh, versions 5.0, 5.0a

SYMPTOMS

In Microsoft Excel 5.0, when you write or record a macro, you have the option to run it from a command on the Tools menu. If you move or copy the macro, the command may appear more than once on the Tools menu. Note also that if you delete the macro, the command may remain on the Tools menu, and you will be unable to delete it.

CAUSES

You may have duplicate commands on the Tools menu when you do either of the following:

  • You copy the macro to another location in the workbook. When you do this, the first command will run the macro from the original location, and the second command will run the macro in the new location.

        -or-
    
  • You move the macro to a different location in the workbook. When you do this, there will be two commands on the Tools menu to run the same macro. The first command attempts to run the macro from its original location. Choosing this command will result in an error message, because Microsoft Excel will be unable to find the macro. The second command runs macro from its new location.

If you delete the macro and then choose the command, you will receive an error message. You receive an error message because Microsoft Excel is unable to find the macro.

WORKAROUND

To avoid the above problems, use the following guidelines when you assign macros to commands on the Tools menu:

  • Before you add a command to the Tools menu, verify that it is in a sensible location (so you won't need to move it later on).

        -and-
    
  • BEFORE you move, copy, or delete a macro, follow the procedure below to remove its custom command from the tools menu.

To remove a macro command from the Tools menu

  1. Verify that the macro is in the workbook where the information has been saved. (If the macro has been moved to a different workbook, copy it back to the original workbook.)

  2. On the Tools menu, click Macro.

  3. Select the name of the macro that you want to change the options for, and click Options.

  4. Clear the Menu Item On Tools Menu check box.

NOTE: If you delete the macro before you remove the command from the Tools menu, the only way to remove the command is to re-create the workbook.

STATUS

This is a known problem in the versions of Microsoft Excel listed at the beginning of this article. The problem was corrected in Microsoft Excel for Windows 95, version 7.0, Microsoft Excel 97, and Microsoft Excel 98 Macintosh Edition.

REFERENCES

"Visual Basic User's Guide," version 5.0, Chapter 1, "Setting and Changing Macro Options"

"Visual Basic User's Guide," version 5.0, Chapter 12, "Menus and Toolbars"

For more information about Adding a macro to the Tools menu, choose the Search button in Help and type:

   commands, adding macros as


Additional query words: 5.00 5.00a 5.00c XL5
Keywords : kbcode kbmacro kbprg
Version : WINDOWS:5.0,5.0c; MACINTOSH:5.0,5.0a
Platform : MACINTOSH WINDOWS


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: February 2, 1998
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.