Article ID: 159223
Article Last Modified on 10/20/2000
APPLIES TO
- Microsoft Excel 97 Standard Edition
This article was previously published under Q159223
SYMPTOMS
When you click a menu command while recording a Visual Basic for
Applications macro, Microsoft Excel does not record the macro code for the
menu command you clicked. When you run the recorded macro, it may not
perform as expected.
CAUSE
This behavior occurs if while recording a macro, you click a menu command
that was added to a menu by an add-in file included with Microsoft
Excel 97. For example, when you click Save As HTML on the File menu while
recording a macro, the recorded macro does not contain code to run the
macro assigned to the Save As HTML command. Microsoft Excel
does not record the code because the menu command was added by the Html.xla
add-in file.
This behavior is by design of Microsoft Excel.
RESOLUTION
If you are creating a macro that executes code assigned to a menu
command, you must manually edit the macro and add the appropriate code.
Code assigned to a menu will be assigned using the OnAction property in
Microsoft Visual Basic for Applications.
For additional information, please see the following article in the
Microsoft Knowledge Base:
166755 WE1183: "Customizing Menu Bars, Menus, and Menu Items"
Note that some of the affected menu commands use their own commands; for
example, the Solver add-in contains commands that you can add to your macro
when you want to set up and execute the Solver.
NOTE: Add-in macros cannot be edited as they are protected and hidden.
Additional query words: XL97
Keywords: kbmacro kbprb kbfaq KB159223