Name

commandbar.ShowPopup([x], [y])

Synopsis

Displays a context menu bar at the specified coordinates. Causes an error if the command bar does not have a Type property of msoBarTypePopup.

Argument

Settings

x

The horizontal position of the menu in pixels

y

The vertical position of the menu in pixels

The following code pops up a context menu created earlier:

Sub ShowMenu( )
    CommandBars("ContextMenu1").ShowPopup 100, 200
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.