Application MacroOptions Method

Purpose

This method corresponds to options in the Macro Options dialog box. You can also use this method to display a user defined function (UDF) in a built-in or new category within the Insert Function dialog box.

Syntax

MacroOptions(Macro, Description, HasMenu, MenuText, HasShortcutKey, ShortcutKey, Category, StatusBar, HelpContextID, HelpFile, ArgumentDescriptions)

Optional Parameters

Macro

The macro name or the name of a user defined function (UDF).

Description

The macro description.

HasMenu

This argument is ignored.

MenuText

This argument is ignored.

HasShortcutKey

True to assign a shortcut key to the macro (ShortcutKey must also be specified). If this argument is False, no shortcut key is assigned to the macro. If the macro already has a shortcut key, setting this argument to False removes the shortcut key. The default value is False.

ShortcutKey

Required if HasShortcutKey is True; ignored otherwise. The shortcut key.

Category

An integer that specifies an existing macro function category (Financial, Date & Time, or User Defined, for example). You can also specify a string for a custom category. If you provide a string it will be treated as the category name that is displayed in the Insert Function dialog box. If the category name has never been used, a new category is defined with that name. If you use a category name that is the same as a built-in name, Microsoft Excel will map the user defined function to that built-in category.

StatusBar

The status bar text for the macro.

HelpContextID

An integer that specifies the context ID for the Help topic assigned to the macro.

HelpFile

The name of the Help file that contains the Help topic defined by HelpContextId.

ArgumentDescriptions

A one-dimensional array that contains the descriptions for the arguments to a UDF that are displayed in the Function Arguments dialog box.