WORKAROUND
Microsoft provides programming examples for illustration only, without warranty either expressed or implied. This includes, but is not limited to, the implied warranties of merchantability or fitness for a particular purpose. This article assumes that you are familiar with the programming language that is being demonstrated and with the tools that are used to create and to debug procedures. Microsoft support engineers can help explain the functionality of a particular procedure, but they will not modify these examples to provide added functionality or construct procedures to meet your specific requirements.
Most functionality originally provided by the controls in the Macro Options
dialog box is available when you run a macro that uses the MacroOptions
method.
The MacroOptions method in Microsoft Excel uses the syntax:
Application.MacroOptions Macro:=<macroname>, <optional arguments>
where <macroname> is the name of the macro whose options you want to
change. The optional arguments are separated by commas.
Each control in the Macro Options dialog box has a corresponding optional
argument that you can add to the MacroOptions method. The following table
lists the controls previously available in the Macro Options dialog box and
the optional argument that allows you to change the setting in question:
Control MacroOptions Optional Argument
----------------------------------------------------------------------
Description box Description:=<variant, a description of the
macro>
Menu Item In HasMenu:=<variant, True or False>*
'Tools' Menu check
box
Menu Text box MenuText:=<variant, the text that should appear
on the Tools menu>*
Keyboard Shortcut HasShortcutKey:=<variant, True or False>
check box
Option+Cmd+ box ShortcutKey:=<variant, a text string containing a
single letter, either uppercase or lowercase>
Function Category Category:=<variant, a number that specifies the
list box macro function category>
Status Bar Text StatusBar:=<variant, text to appear in the status
box bar when the user points to a menu item
assigned to the macro>
Help Context ID HelpContextId:=<variant, a number that specifies
For This Macro the context ID for the Help topic assigned to
box the macro>
Help File Name HelpFile:=<variant, the name of the Help file
box assigned to the macro>
For example, assume you have a macro called "Test" and you want to set the
following options for the macro.
Option Value
-----------------------------------------------
Description This is my test macro.
Shortcut Key yes, OPTION+COMMAND+j
Status Bar Text Test Macro written by J. Tech
Help Context ID 15
Help File Name Help Files:My Help File
You can set these options by executing the following command in a Microsoft
Visual Basic for Applications macro:
Application.MacroOptions Macro:="Test", _
Description:="This is my test macro.", HasShortcutKey:=True, _
ShortcutKey:="j", StatusBar:="Test Macro written by J. Tech", _
HelpContextId:=15, HelpFile:="Help Files:My Help File"
Because the Macro Options dialog box in Microsoft Excel 98 Macintosh
Edition does not contain all of the same controls as in earlier versions of
Microsoft Excel, this is the only method you can use to set most of the
macro options.
Note: The arguments marked above with an asterisk (*), HasMenu and
MenuText, are ignored in Microsoft Excel 98 Macintosh Edition. This
functionality is no longer available.
For additional information, please see the following article in the
Microsoft Knowledge Base:
157203 XL97: Cannot Add Macros to the Tools Menu