Microsoft Office Tutorials and References
In Depth Information
CommandBars Collection
The CommandBars collection contains all the command bars defined in Excel. For the most
part, the CommandBars collection is just a normal collection with properties and methods
such as Item , Count , and Add . However, it also has some properties that determine how the
command bars operate, including enabling or disabling features such as adaptive menus,
menu customization, and menu animation.
Table 17-1 contains a list of the key properties and methods of the CommandBars collection.
Table 17-1. Key Properties and Methods of the CommandBars Collection
Property/Method
Description
AdaptiveMenus
Property: when True , means that adaptive menus will be
used in Excel.
Add(Name, Position,
Method: creates a new command bar object and adds it to
MenuBar, Temporary)
CommandBars . Name is the name of the new command bar,
Position specifies where the command bar is located,
MenuBar , when True , means that the command bar replaces
the currently active menu bar. Temporary , when True , means
that the command bar will be automatically deleted when
Excel ends.
Count
Property (read-only): returns the number of CommandBars in
the collection.
DisableCustomize
Property: when True , means that command bars may not be
customized by the user.
FindControl(Type, Id, Tag,
Visible, Recursive)
Method: returns an object reference to the
CommandBarControl object that matches the specified
criteria. Type specifies the type of control using the
MsoControlType enumeration. Id specifies the name of the
control. Tag searches for matches using the control’s Ta g
property. Visible , when True , limits the search to only those
controls that are visible; Recursive , when True , searches
through the current CommandBar object and all of its pop-up
subtoolbars.
Item(Index)
Property: returns the command bar object specified by Index .
LargeButtons
Property: when True , means that toolbar buttons will be
displayed larger than normal.
MenuAnimationStyle
Property: specifies how the command bar is animated.
Can specify one of the following: msoMenuAnimationNone ,
msnMenuAnimationRandom , msoMenuAnimationSlide , or
msoMenuAnimationUnfold .
Search JabSto ::




Custom Search