Microsoft KB Archive/122575

= "Cannot find macro 'Book1!Macro_Name'" with Menu Item =

Article ID: 122575

Article Last Modified on 8/15/2005

-

APPLIES TO


 * Microsoft Excel 95 Standard Edition
 * Microsoft Excel 5.0c
 * Microsoft Excel 5.0 Standard Edition
 * Microsoft Excel 5.0 for Macintosh

-



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:


 * 1) Restore the original name to the macro.
 * 2) From the tools menu, choose Macro.
 * 3) In the Macro box, under Macro/Name Reference, select the name of your macro, and choose Options.
 * 4) 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.

