Gruppe
Menue
Problem
Wie kann ich überprüfen, ob in der Arbeitsblattmenüleiste ein bestimmtes Menü enthalten ist und wo es sich, wenn ja, befindet?
StandardModule: basMain
Sub MenuTest()
Dim oCntr As CommandBarControl
Dim bln As Boolean
With Application.CommandBars("Worksheet Menu Bar")
For Each oCntr In .Controls
If oCntr.Type = msoControlButtonPopup And _
oCntr.Caption = "MeinMenue" Then
bln = True
Exit For
End If
Next oCntr
End With
If bln = True Then
MsgBox "Das Menü ""MeinMenue"" existiert!"
Else
MsgBox "Das Menü ""MeinMenue"" existiert nicht!"
End If
End Sub