Mit dem folgenden Makro können Sie die Verfügbarkeit der Arbeitsmappen-Menüleiste, der Standardsymbolleiste und einer benutzerdefinierten Befehlsleiste umschalten.

Wenn Sie das Makro zum ersten Mal ausführen, werden das Menü und die Standardleiste deaktiviert. Die benutzerdefinierte Symbolleiste ist aktiviert.

Wenn Sie das Makro das nächste Mal ausführen, werden das Menü und die Standardleiste aktiviert. Die benutzerdefinierte Befehlsleiste ist deaktiviert.

Sub ToggleCommandBars()

Dim cbEnabled As Boolean

' get the current commandbar state

cbEnabled = Not Application.CommandBars(1).Enabled

' apply the new state to the Workbook Menu Bar

Application.CommandBars(1).Enabled = cbEnabled

' apply the new state to the Standard toolbar

Application.CommandBars("StandardOPE").Enabled = cbEnabled

' apply the new state to a custom commandbar (the oposite of the previous two)

Application.CommandBars("MyCustomCommandBar").Enabled = Not cbEnabled

End Sub