Microsoft Knowledge Base

XL: Menu Command Runs Macro from Wrong Add-In

Last reviewed: June 12, 1997
Article ID: Q126663
5.00 5.00c 7.00 | 5.00
WINDOWS         | MACINTOSH
kbprg

The information in this article applies to:

  • Microsoft Excel for Windows, versions 5.0, 5.0c
  • Microsoft Excel for the Macintosh, version 5.0
  • Microsoft Excel for Windows 95, version 7.0

SYMPTOMS

In Microsoft Excel, when you create an add-in file, and you add a menu item to the add-in that runs a macro contained in the add-in, when you open that add-in file, and choose the menu item, the wrong macro may be run.

CAUSE

This behavior occurs if you open an add-in that contains a macro with the same name as the macro that is assigned to the menu item BEFORE you open the add-in that actually contains the menu item and the macro that is assigned to the menu item.

For example, if you create two different add-in files, RIGHT.XLA and WRONG.XLA, that both contain a macro called "Test," and you add a menu item to RIGHT.XLA that runs the macro Test in RIGHT.XLA, the macro "Test" in WRONG.XLA runs when you choose the menu item if you open WRONG.XLA before you open RIGHT.XLA.

WORKAROUND

To avoid running the wrong macro when you choose a menu item that is associated with an add-in file, use either of the following methods.

Method 1: When you create an add-in file, create macros in the add-in with

          names that are different from macro names in other add-in files
          that you use.

Method 2: If you have two or more add-in files that contain a macro with
          the same name, open the add-in that contains an added menu item
          before you open any other add-in file.

STATUS

Microsoft has confirmed this to be a problem in the Microsoft products listed at the beginning of this article. We are researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available.

REFERENCES

For more information about the Menu Editor Command (Tools Menu), choose the Search button in Help and type:

   menu Editor command (Tools menu)


KBCategory: kbprg
KBSubcategory:

Additional reference words: 7.00 5.00 5.00c addin
Keywords : kbprg
Version : 5.00 5.00c 7.00 | 5.00
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: June 12, 1997
©1997 Microsoft Corporation. All rights reserved. Legal Notices.