Table of contents
Collapse the table of content
Expand the table of content

Application.CommandBars Property (Project)

office 365 dev account|Last Updated: 6/12/2017
1 Contributor

Gets a CommandBars collection that represents all the command bars in the application. Read-only CommandBars.


expression. CommandBars

expression A variable that represents an Application object.


For more information, see see the CommandBars collection object in the Microsoft Office Visual Basic Reference.


The following example deletes all custom command bars that aren't visible.

Sub RemoveCommandBars() 
 Dim Bar As CommandBar 

 For Each Bar In Application.CommandBars 
 If Not Bar.BuiltIn And Not Bar.Visible Then Bar.Delete 

End Sub
© 2018 Microsoft