Export (0) Print
Expand All
Expand Minimize

Application.CommandBars Property

Office 2007
Returns a CommandBars object that represents the Microsoft Excel command bars. Read-only.

Syntax

expression.CommandBars

expression   An expression that returns a Application object.

Remarks

Used with the Application object, this property returns the set of built-in and custom command bars available to the application.

When a workbook is embedded in another application and activated by the user by double-clicking the workbook, using this property with a Workbook object returns the set of Microsoft Excel command bars available within the other application. At all other times, using this property with a Workbook object returns Nothing.

There is no programmatic way to return the set of command bars attached to a workbook.

Example

This example deletes all custom command bars that aren’t visible.

Visual Basic for Applications
For Each bar In Application.CommandBars
    If Not bar.BuiltIn And Not bar.Visible Then bar.Delete
Next



Community Additions

ADD
Show:
© 2014 Microsoft