Microsoft KB Archive/67460

{| = Excel: Using ADD.COMMAND to Move Built-in Menu Items =
 * width="100%"|

Last reviewed: November 2, 1994

Article ID: Q67460

SUMMARY
The macro function ADD.COMMAND can be used in Microsoft Excel version 3.00 to replace built-in menu items that were removed with DELETE.COMMAND. However, the following conditions must be met for ADD.COMMAND to function properly:

 DELETE.COMMAND must have been used to delete the menu item. The command that was deleted can be added back only to the same menu on the same bar. ADD.COMMAND cannot be used to change which menu a command is located on, but it can be used to change the position of the command (on the same menu).  Either the name of the command (as a text string) or the unique ID number (returned by DELETE.COMMAND) must be used to restore the menu item. For example, to add the Quit command the the File menu on menu bar 1 (Full Menus), the following command is used: =ADD.COMMAND(1,&quot;File&quot;,&quot;Quit&quot;,23) The number 1 specifies the bar number, &quot;File&quot; is the name (as a text string) of the menu, &quot;Quit&quot; is the name of the command, and 23 tells Excel to place the command in the 23rd position on the menu (position is optional). 

For more information on ADD.COMMAND, see pages 5-6 of the &quot;Microsoft Excel Function Reference&quot; version 3.0 manual. For more information on DELETE.COMMAND, see pages 51-52 of the &quot;Microsoft Excel Function Reference&quot; version 3.0 manual.
 * }