Visible Property

Microsoft Office Visual Basic

expression.Visible

expression    Required. An expression that returns one of the objects in the Applies To list.

Remarks

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.

Example

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
Next
If Not foundFlag Then
    MsgBox "'Forms'command bar is not in the collection."
End If
		

This example makes the Office Assistant visible and sets its animation.

With Application.Assistant
    .Visible = True
    .Sounds = True
    .Animation = msoAnimationBeginSpeaking
End With