아래 매크로를 사용하여 통합 문서 메뉴 모음, 표준 도구 모음 및 사용자 지정 명령 모음의 가용성을 전환 할 수 있습니다.

매크로를 처음 실행하면 메뉴와 표준 막대가 비활성화되고 사용자 정의 도구 모음이 활성화됩니다.

다음에 매크로를 실행하면 메뉴와 표준 표시 줄이 활성화되고 사용자 지정 CommandBar가 비활성화됩니다.

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