hide menu bar

March 01st, 2012 - 11:39 am ET by kalpesh | Report spam
Hello,

my workbook contin 3 worksheet

IN worksheet 1 i create a macro for hide toolbar & menubar when activet sheet 1

my code is below


Sub RemoveToolbars()

On Error Resume Next

With Application

.DisplayFullScreen = True

.CommandBars("Full Screen").Visible = False

.CommandBars("MyToolbar").Enabled = True

.CommandBars("MyToolbar").Visible = True

.CommandBars("Worksheet Menu Bar").Enabled = False

End With

On Error GoTo 0

End Sub

Sub RestoreToolbars()

On Error Resume Next

With Application

.DisplayFullScreen = False

.CommandBars("MyToolbar").Enabled = False

.CommandBars("Worksheet Menu Bar").Enabled = True

End With

On Error GoTo 0

End Sub


Private Sub Worksheet_Activate()
Call RemoveToolbars
Worksheets(1).ScrollArea = "a1:f10"

End Sub


Private Sub Worksheet_Deactivate()
Call RestoreToolbars
End Sub


now my problem is when sheet 1 activet menubar is hide but sheet 1 is activate & close the excel & then after again i open this file the menubar is do not hide but i select sheet 2 & then select sheet 1 then menubar is hide

why
email Follow the discussionReplies Make a reply

Similar topics