SHOW.TOOLBAR macro

Equivalent to selecting the check box corresponding to a toolbar on the Toolbars tab in the Customize dialog box, which appears when you select the Customize command (View menu, Toolbars submenu). Hides or displays a toolbar. Use SHOW.TOOLBAR to display or hide a menu bar you have created with the ADD.BAR function or to display a built-in Microsoft Excel 95 or earlier version toolbar.

Syntax

SHOW.TOOLBAR(bar_id, visible, dock, x_pos, y_pos, width, protect, tool_tips, large_buttons, color_buttons)

Bar_id    is a number or name of a toolbar corresponding to the toolbars you want to display. For detailed information about bar_id, see ADD.TOOL.

Visible    is a logical value that, if TRUE, specifies that the toolbar is visible or, if FALSE, specifies that the toolbar is hidden.

Dock    specifies the docking location of the toolbar.

Dock

Position of toolbar

1

Top of workspace

2

Left edge of workspace

3

Right edge of workspace

4

Bottom of workspace

5

Floating (not docked)

X_pos    specifies the horizontal position of the toolbar.

Y_pos    specifies the vertical position of the toolbar.

 

Width    specifies the width of the toolbar and is measured in points. If you omit width, Microsoft Excel uses the existing width setting.

Protect    is a number specifying the degree to which you can modify a toolbar and its buttons. Each succeeding protect number retains the protection status of its previous numbers. For example, a protect status of 3 (a toolbar cannot become docked if it is floating) assumes the protection status of 0, 1, and 2 as well.

Protect

Description

0

Default. Toolbars can be re-shaped, docked, and floating. Toolbar buttons can be removed from and moved to the toolbar.

1

Toolbars can be re-shaped, docked, and floating. Toolbar buttons can not be removed from nor moved to the toolbar.

2

A floating toolbar cannot be re-shaped. It can be docked.

3

A floating toolbar cannot be docked. If it is already docked, it cannot become floating.

4

The toolbar cannot be moved at all. If it is already floating, it cannot be re-shaped or moved. If it is docked, it cannot become un-docked.

Tool_tips    is a logical value that corresponds to the Show Screentips On Toolbars check box on the Options tab. If TRUE, ScreenTips will be displayed. If FALSE, ScreenTips will not be displayed.

Large Buttons    is a logical value that corresponds to the Large Icons check box on the Options tab. If TRUE, large icons will be displayed. If FALSE, large icons will not be displayed.

Color_buttons    is a logical value that corresponds to the Color Toolbars check box. If TRUE, the toolbar buttons will be displayed in color. If FALSE, the toolbar buttons will not be displayed in color. This argument is for compatibility with Microsoft Excel version 5.0.

Related Functions

ADD.BAR   Adds a menu bar

ADD.TOOLBAR   Creates a new toolbar with the specified tools

Return to index