Resetting all builtin toolbars

The following procedure resets all built-in toolbars to their original state:

Sub

ResetAll()

Dim cbar As CommandBar

For Each cbar In Application.CommandBars

If cbar.Type = msoBarTypeNormal Then

cbar.Reset

End If

Next cbar

End

Using the Reset method on a custom toolbar has no effect (and does not generate an error).

Be careful with the preceding routine. Executing it erases all of your cus-tomizations to all built-in toolbars. The toolbars will be just as they were when you first installed Excel.

0 0

Post a comment