Name

commandbarcontrol.Execute( )

Synopsis

Executes the control’s command. For example, the following code displays the About Excel dialog box:

Sub ShowAbout( )
    Dim cbc As CommandBarControl
    ' &About Microsoft Office Excel command is ID 927.
    Set cbc = CommandBars.FindControl(msoControlButton, 927)
    cbc.Execute
End Sub

Get Programming Excel with VBA and .NET now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.