April 2006
Beginner
1114 pages
98h 16m
English
If you change an existing menu, you may want to remove your changes without deleting the entire menu. To do that, use the Reset method as shown here:
Sub RestoreHelpMenu( )
Dim cb As CommandBar, cpop As CommandBarPopup
Dim index As Integer
' Get the menu bar.
Set cb = Application.CommandBars("Worksheet Menu Bar")
' Get the Help menu.
Set cpop = cb.FindControl(msoControlPopup, 30010)
' Remove changes.
cpop.Reset
End SubThe preceding code restores the default menu settings for the Help menu, removing the changes made by the ChangeHelpMenu procedure earlier.
You can also call Reset on the CommandBar object to restore the defaults for all menus:
Sub RestoreMenuBar( )
Dim cb As CommandBar
' Get the menu bar
Set cb = Application.CommandBars("Worksheet Menu Bar")
' Remove changes.
cb.Reset
End Sub
Reset removes the user’s changes as well as changes made in code.
Read now
Unlock full access