Microsoft KB Archive/157347

= XL97: Change in ADD.MENU Macro Position Argument =

Article ID: 157347

Article Last Modified on 10/21/2000

-

APPLIES TO


 * Microsoft Excel 97 Standard Edition

-



This article was previously published under Q157347



SYMPTOMS
If you run a Microsoft Excel version 4.0 (XLM) macro that contains the ADD.MENU macro function, the location of the menu you add may be different from the location in earlier versions of Microsoft Excel.



CAUSE
The XLM ADD.MENU macro function has an optional third argument called Position. If you do not specify anything for the Position argument in Microsoft Excel versions 4.0, 5.0, and 7.0, the ADD.MENU function adds your custom menu to the left of the Help menu. If you do not specify anything for the Position argument in Microsoft Excel 97, the function adds your custom menu to the right of the Help menu.



RESOLUTION
If you want your custom menu to appear immediately to the left of the Help menu in Microsoft Excel 97, you must specify something for the Position argument.

Example:

If you have your Menu definition table in a defined name called "Testmenu" and you want your custom menu to appear on the Worksheet menu bar, use the following macro command: =ADD.MENU(10,Testmenu,"Help")



MORE INFORMATION
The ADD.MENU macro function has the following syntax:

=ADD.MENU(bar_num, menu_ref, Position)

NOTE: The first two arguments are required.

Descriptions of the ADD.MENU arguments
bar_num:

the ID number for the menu bar to which you want your menu added.

menu_ref:

the reference on your Macro sheet for your Menu definition table.

Position:

a name (as text) or number of an existing menu. Custom menus areadded to the left of the menu specified with the Position argument.

Additional query words: XL97

Keywords: kbmacro kbprogramming KB157347

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.