The information in this article applies to:
SUMMARYThe [Init Commands] section in the EXCEL.INI file (in version 5.0 the EXCEL5.INI file) allow custom commands to be added to the Microsoft Excel default menus without having to execute a macro to do so. MORE INFORMATION
The general syntax for an entry in the [Init Commands] section appears
as follows:
Syntax for [Init Commands]<Command_name>=<menu_#>,<menu_name>,<command>,<macro_name>, <position>,<blank>,<status_msg>,<help><Command_name> is the name you will use to distinguish one command from another. The command_name is required, but is essentially ignored by Excel and has no effect on the command or how it will appear in the menu. <Menu_#> is the Excel default menu bar number in which you want the command to be available. A number 1 through 6 is required. If you want a command to be available in all six default menus, six separate [Init Command] entries are required. <Menu_name> is the name, or number, of the menu under which you want the command to appear. Numbering the menus begins on the left, starting with 1. <Command> is the actual command that will appear under the specified menu. As with all custom menu commands an ampersand (&) can be placed in front of the letter you want to make a menu accelerator key. This item is required. <Macro_name> is the name of the macro you want to run when the custom command is selected. Unless there is no doubt that the macro or add-in will be open, the drive and path to the macro should be specified. When giving the drive and path, the macro_name parameter should take the following form: 'C:\EXCEL\DATA\MACRO1.XLM'!TEST (Note the single quotation marks surrounding the drive, path, and sheet name.) This item is required. In version 5.0 when you refer to the macro file name, the name of the workbook must be in brackets, with the sheet name following. 'C:\EXCEL\DATA\[BOOK1.XLS]MACRO1'!TEST <Position> can be either the number representing the relative position the command should take in the command list or the name of the command above which you want your command to appear. Numbering begins with 1, starting from the top. Command names should be spelled just as they appear on the screen, including ellipses (...) if necessary. This item is optional, and entries without this parameter will appear at the bottom of the specified menu's command list. <Blank> should always be left blank. <Status_msg> is optional. The text you want to appear in the status bar when this command is selected should be placed here. <help> specifies the help file and topic that should appear if the user presses F1 while the command is highlighted in the menu. Sample EntryThe following is an example:
The above sample entry will:
The EXCEL.INF cannot be modified to include custom [Init Commands] entries. REFERENCES
"Online Help," version 5.0 Additional query words: 3.0 4.0 5.0 solver
Keywords : |
Last Reviewed: March 22, 1999 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |