"Cannot find macro 'Book1!Macro_Name'" with Menu Item (122575)
The information in this article applies to:
- Microsoft Excel for Windows 95
- Microsoft Excel for Windows 5.0c
- Microsoft Excel for Windows NT 5.0
- Microsoft Excel for the Macintosh 5.0
This article was previously published under Q122575 SYMPTOMS
In Microsoft Excel, when you assign a macro to a menu command on the Tools
menu, and you then change the name of the macro, you will receive the
following error message when you choose the menu command
Cannot find macro 'Book1!Macro_Name'
where Book1 is the name of the workbook file the macro was stored in, and
Macro_Name is the original name of the macro.
CAUSE
When you assign a macro to a command on the Tools menu, Microsoft Excel
creates a link to the macro in the specified workbook. When you change the
name of the macro, this change is not reflected in the link between the
macro and the menu command; therefore, when Microsoft Excel tries to run
the original macro, it is unable to locate it.
WORKAROUND
To work around this situation, do the following:
- Restore the original name to the macro.
- From the tools menu, choose Macro.
- In the Macro box, under Macro/Name Reference, select the name of your
macro, and choose Options.
- In the Macro Options box, under Assign to, clear the Menu Item On Tools
Menu check box.
To associate the new name with a command on the Tools menu, change the name
of the macro first, and then associate it with a menu command.
REFERENCES
"Visual Basic User's Guide," version 5.0, page 16
Modification Type: | Minor | Last Reviewed: | 8/15/2005 |
---|
Keywords: | KB122575 |
---|
|