Restoring a Deleted Worksheet Menu Bar
Posted by Stan on October 01, 2001 5:44 AM
I used the code below to hide and then view the items in the Worksheet Menu Bar. Unfortunately the program hung and I lost everything except the File and Edit commands. Nothing was saved on sheet 5. Is there a way to restore (at least the default) settings for the menu bar without reinstalling Excel?
Cheers
Stan
*********************************
Sub HideWorkSheetMenuBar ()
Dim ctl as CommandBarControl
Write name of current menu bar controls to sheet 5
Sheet5.Activate
Range (B1).Select
For Each ctl in Application.CommandBars(Worksheet Menu Bar).Controls
ActiveCell.Value = ctlName
If ctl.Index >=3 then
ctl.Visible = False
end if
Activecell.Offset(1,0).Activate
Next ctl
End Sub
Sub RestoreWorkSheetMenuBar ()
Sheet5.Activate
Range (B1).Select
Do While ActiveCell.Value <> vbNullString
Application.CommandBars(WorkSheet Menu Bar, ActiveCell.Value).Visible
ActiveCell.Offset(1,0).Select
Loop
End Sub