Andy Pope recently posted this code to list all command bar controls:
Sub ListControlIDs()
Dim oCBC As CommandBarControl
Dim iRow As Long
Dim iID As Long
On Error Resume Next
For iID = 1 To 31308
Set oCBC = Application.CommandBars.FindControl(ID:=iID)
If Not oCBC Is Nothing Then
iRow = iRow + 1
Cells(iRow, 1).Select
Cells(iRow, 1) = iID
Cells(iRow, 2) = oCBC.Caption
Cells(iRow, 3) = oCBC.Parent.Name
End If
Next
End Sub
Once you find it in the list, you can execute it. For example, type this in the Immediate window:
Application.CommandBars.FindControl(ID:=1849).Execute
Bookmarks