Skip to content

Instantly share code, notes, and snippets.

@dck-jp
Created August 23, 2012 12:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dck-jp/3436226 to your computer and use it in GitHub Desktop.
Save dck-jp/3436226 to your computer and use it in GitHub Desktop.
ResetAllCommandBars @ VBA
Sub ResetAllCommandBars()
Dim objCommandBar As Office.CommandBar
For Each objCommandBar In Application.CommandBars
If objCommandBar.BuiltIn Then
objCommandBar.Reset
End If
Next
End Sub
Sub ResetAllCommandBars()
Dim objCommandBar As Office.CommandBar
For Each objCommandBar In Application.CommandBars
On Error Resume Next 'Reset()で発生するエラーはなかったことに
objCommandBar.Reset
Next
End Sub
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment