Microsoft Knowledge Base

XL: Err Msg: "Cannot Find Macro..." Using Key Combination

Last reviewed: September 13, 1996
Article ID: Q113793
The information in this article applies to:
  • Microsoft Excel for Windows, version 5.0
  • Microsoft Excel for the Macintosh, version 5.0
  • Microsoft Excel for Windows 95, version 7.0

SYMPTOMS

In Microsoft Excel version, the following error message may appear if you change the name of a Visual Basic macro and then try to run that macro by pressing the key combination assigned to it:

   Cannot find macro '<workbook name>!<macro name>'.

After the error message appears, and you click the OK button to dismiss it, you can then run the macro successfully using the key combination.

CAUSE

When you change the name of a Visual Basic macro, the key combination assigned to it may not be reassigned right away.

MORE INFORMATION

In Microsoft Excel, you can change the name of a Visual Basic macro by editing the text on a module sheet. For example, you can change

   Sub Macro1()

to:

   Sub Macro2()

When you edit the text and change the 1 to a 2, if a control key combination has been assigned to Macro1 through the Macro Options dialog box (also available while recording a macro by choosing the Options button from the Record dialog box), the above error message will occur the first time you use the control key combination (after you have changed the name of the macro to Macro2).

REFERENCES

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


KBCategory: kbusage kberrmsg
KBSubcategory:

Additional reference words: 5.00 7.00 hot hotkey quick



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: September 13, 1996
©1997 Microsoft Corporation. All rights reserved. Legal Notices.