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

CommandBar.Visible Property (Office)

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

Gets or sets the Visible property of the command bar. True if the command bar is visible. Read/write.

Note The use of CommandBars in some Microsoft Office applications has been superseded by the new ribbon component of the Microsoft Office Fluent user interface. For more information, search Help for the keyword "ribbon."


expression. Visible

expression A variable that represents a CommandBar object.

Return Value



The Visible property for newly created custom command bars is False by default.

The Enabled property for a command bar must be set to True before the Visible property is set to True.


This example steps through the collection of command bars to find the Forms command bar. If the Forms command bar is found, the example makes it visible and protects its docking state.

foundFlag = False  
For Each cmdbar In CommandBars 
    If cmdbar.Name = "Forms" Then 
        cmdbar.Protection = msoBarNoChangeDock 
        cmdbar.Visible = True  
        foundFlag = True  
    End If 
If Not foundFlag Then 
    MsgBox "'Forms'command bar is not in the collection." 
End If

See also


CommandBar Object

Other resources

CommandBar Object Members

© 2018 Microsoft