ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Enable to hide Worksheet Menu Bar (https://www.excelbanter.com/excel-programming/425500-enable-hide-worksheet-menu-bar.html)

cpmame

Enable to hide Worksheet Menu Bar
 
I have the following code in the ThisWorkbook (excel 2007), it works exactly
the way I want at the initial launch of the program. But once I minimize the
program and turn it back on the toolbar reappear. Is this a bug or something
wrong with my code? Please help.


Private Sub Workbook_Activate()
Call RemoveToolbars
End Sub

Private Sub Workbook_Deactivate()
Call RestoreToolbars
End Sub

Private Sub RemoveToolbars()
On Error Resume Next
With Application
.DisplayFullScreen = True
.CommandBars("Full Screen").Visible = False
.CommandBars("Worksheet Menu Bar").Enabled = False
End With
On Error GoTo 0
End Sub

Private Sub RestoreToolbars()
On Error Resume Next
With Application
.DisplayFullScreen = False
.CommandBars("Worksheet Menu Bar").Enabled = True
End With
On Error GoTo 0
End Sub



royUK[_104_]

Enable to hide Worksheet Menu Bar
 

Ecel 2007 does not suport CommadBars it uses the Ribbon.


--
royUK

Hope that helps, RoyUK
For tips & examples visit my 'web site' (http://www.excel-it.com/)
------------------------------------------------------------------------
royUK's Profile: http://www.thecodecage.com/forumz/member.php?userid=15
View this thread: http://www.thecodecage.com/forumz/sh...ad.php?t=74757



All times are GMT +1. The time now is 03:39 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com