Microsoft KB Archive/107749

From BetaArchive Wiki
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

Microsoft Knowledge Base

Excel: Menu and Toolbar Macro Functions Add Blank Items

Last reviewed: June 30, 1997
Article ID: Q107749

The information in this article applies to:

  • Microsoft Excel for Windows, versions 2.x, 3.0, 4.0, 4.0a
  • Microsoft Excel for the Macintosh, versions 3.0, 4.0

SUMMARY

Menu and toolbar macro functions such as ADD.BAR(), ADD.COMMAND(), ADD.MENU(), ADD.TOOL(), and ADD.TOOLBAR() may add blank items when they reference blank cells.

MORE INFORMATION

The ADD.BAR() macro function is used to create a new menu bar. If you display the menu bar using the SHOW.BAR() command before adding custom menus and commands, an empty menu bar will be displayed.

The ADD.MENU() macro function is used to add menus to new or built-in menu bars. If the menu_ref argument consists of empty cells, a blank menu with no commands will be added.

The ADD.COMMAND() macro function is used to add commands to existing menus on built-in or custom menu bars. If the command_ref argument consists of empty cells, a blank command is added to the specified menu.

The ADD.TOOLBAR() macro function (Microsoft Excel version 4.0 only) is used to create a custom toolbar. If the tool_ref argument points to empty cells or is omitted, an empty toolbar will be created. To display the toolbar, the SHOW.TOOLBAR() function must be used.

The ADD.TOOL() macro function (Microsoft Excel version 4.0 only) is used to add tools to built-in or custom toolbars. If the tool_ref argument consists of empty cells, no tool is added to the specified toolbar.

Steps to Reproduce Behavior

  1. In Microsoft Excel version 4.0, choose New from the File menu, then select Macro Sheet and press ENTER to open a new macro sheet.
  2. In the new macro sheet, type the following:

          A1: =ADD.MENU(1,C1:D2,1)
          A2: =RETURN()

    NOTE: Cells C1:D2 must be blank

  3. Select cell A1.
  4. From the Macro menu, choose Run, and press ENTER.

A blank menu will be added to the default menu bar. The blank menu does not contain any commands.

REFERENCES

"Function Reference," version 4.0, pages 7-13 "User's Guide 2," version 4.0, pages 282-291 "Function Reference," version 3.0, pages 4-7 "User's Guide," version 3.0, pages 646-649 "Functions and Macros," version 2.1, pages 197-201


Additional reference words: 4.00 4.00a 3.00 3.00a 2.10 empty

Keywords : kbmacro kbprb kbprg kbprb
Version : 2.X 3.00 4.00 4.00a | 2.X 3.00 4
Platform : MACINTOSH WINDOWS


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: June 30, 1997
©1997 Microsoft Corporation. All rights reserved. Legal Notices.