Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default hiding Worksheet menu bar

this was taken from www.tek-tips.com:

Sub DisableMenu_HideControlBars()
Dim comBar As CommandBar
Dim comCtrl As CommandBarControl
Dim comBtn As CommandBarButton
'This will hide all of the Command bars that are visible
(open)
For Each comBar In CommandBars
If comBar.BuiltIn And comBar.Visible = True Then
comBar.Enabled = False
For Each comCtrl In comBar.Controls
If comCtrl.BuiltIn And comBar.Visible = True Then
comCtrl.Enabled = False
End If
Next comCtrl
End If
Next comBar
' The following will hide/disable the File & Edit items in
Excel's Menu Bar
With CommandBars("Worksheet Menu Bar")
.Enabled = True
With .Controls("File")
.Enabled = False
.Visible = False
End With
With .Controls("Edit")
.Enabled = False
.Visible = False
End With

End Sub

Sub EnableMenu_UnhideControlBars()
Dim comBar As CommandBar
Dim comCtrl As CommandBarControl
Dim comBtn As CommandBarButton
For Each comBar In CommandBars
'This will unhide all of the Command bars that were
visible (open)
If comBar.BuiltIn And comBar.Enabled = False Then
comBar.Visible = True
comBar.Enabled = True
For Each comCtrl In comBar.Controls
If comCtrl.BuiltIn And comBar.Enabled = False
Then
comCtrl.Visible = True
comCtrl.Enabled = True
End If
Next comCtrl
End If
Next comBar
' The following will unhide/enable the File & Edit items
in Excel's Menu Bar
With CommandBars("Worksheet Menu Bar")
.Enabled = True
With .Controls("File")
.Enabled = True
.Visible = True
End With
With .Controls("Edit")
.Enabled = True
.Visible = True
End With
End Sub

-----Original Message-----
Hi,


Is it possible to hide the Worksheet menu bar?

What I'm trying is the following:
CommandBars(1).Visible = False

This gives me an error:
Error -2147467259(80004005) during execution:
Method Visible of CommandBas has failed


Many thanks in advance,

Yves


.

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
hiding the worksheet Narnimar Excel Discussion (Misc queries) 8 July 12th 07 05:30 AM
Hiding a Worksheet oceanmist Excel Discussion (Misc queries) 3 June 14th 07 04:48 PM
Hiding a cell's drop-down menu, dependent on a tick-box selection... mintos Excel Discussion (Misc queries) 1 February 9th 06 02:13 PM
hiding Worksheet menu bar Tom Ogilvy Excel Programming 0 September 17th 03 01:30 PM
hiding Worksheet menu bar Bob Phillips[_5_] Excel Programming 0 September 17th 03 01:30 PM


All times are GMT +1. The time now is 01:04 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"