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 | MACINTOSHkbprg The information in this article applies to:
SYMPTOMSIn 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.
CAUSEThis 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.
WORKAROUNDTo 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.
STATUSMicrosoft 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.
REFERENCESFor more information about the Menu Editor Command (Tools Menu), choose the Search button in Help and type:
menu Editor command (Tools menu) |
|
KBCategory: kbprg
©1997 Microsoft Corporation. All rights reserved. Legal Notices. |