Gruppe
Menue
Problem
Wie kann ich alle Menü- und Symbolleisten in einem Tabellenblatt auflisten?
StandardModule: basMain
Sub IDFinder()
Dim oBar As CommandBar
Dim oCtr As CommandBarControl
Dim oBtn As CommandBarButton
Dim iRow As Integer
Range("A1").Value = "Symbolleiste"
Range("B1").Value = "Lokaler Name"
Range("C1").Value = "Sichtbar"
Range("D1").Value = "Schaltfläche"
Range("E1").Value = "ID"
Range("A1:E1").Font.Bold = True
iRow = 1
For Each oBar In CommandBars
If oBar.BuiltIn Then
iRow = iRow + 1
Cells(iRow, 1) = oBar.Name
Cells(iRow, 2) = oBar.NameLocal
Cells(iRow, 3) = oBar.Visible
For Each oCtr In oBar.Controls
If oCtr.BuiltIn Then
Cells(iRow, 4) = oCtr.Caption
Cells(iRow, 5) = oCtr.ID
iRow = iRow + 1
End If
Next oCtr
End If
Next oBar
Columns.AutoFit
End Sub