CommandBars.FindControl(ID:=)

bsquad

Board Regular
Joined
Mar 15, 2016
Messages
194
I am looking for the Control ID for table cells. I am trying to enable a right click for a SubMenu; I already have 'cell' and ID:=1588 for the Page Layout view, but can't seem to fine the ID for a cell in a table.
 

Excel Facts

Create a Pivot Table on a Map
If your data has zip codes, postal codes, or city names, select the data and use Insert, 3D Map. (Found to right of chart icons).
This code will overwrite Sheet1. Run in a new workbook.
Perhaps the Cell menu holds what you need (line 399 in output, at least in my configuration).

Code:
Option Explicit


Sub ExploreCommandBars()

    Dim bar As CommandBar
    Dim lctlIndex As Long
    Dim lPrintRow As Long
        
    lPrintRow = 2
    With Sheet1
        For Each bar In Application.CommandBars
        'If Not bar.BuiltIn And Not bar.Visible Then bar.Delete
        'Stop
        .Cells(lPrintRow, 1).Value = bar.Name
        .Cells(lPrintRow, 2).Value = bar.Controls.Count
        lPrintRow = lPrintRow + 1
            For lctlIndex = 1 To bar.Controls.Count
                    .Cells(lPrintRow, 2).Value = bar.Controls(lctlIndex).Caption
                    .Cells(lPrintRow, 3).Value = bar.Controls(lctlIndex).ID
                lPrintRow = lPrintRow + 1
            Next
        Next
    End With
End Sub
 
Upvote 0

Forum statistics

Threads
1,223,963
Messages
6,175,656
Members
452,664
Latest member
alpserbetli

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top