LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Hiding all Toolbars

Jonathan,

You should check out the previous posts, I have already answered (a very
similar question) today. Here is that code, modified for your needs

Here is some code to hide them and restore them. This code would go in the
ThisWorkbook code module. Your code to create the special CBs should be run
before you hide the others.

Dim aryCBs

Private Sub Workbook_BeforeClose(Cancel As Boolean)
Dim i As Long

For i = LBound(aryCBs) To UBound(aryCBs)
If oCB.Name = "Worksheet Menu Bar" Then
Application.CommandBars(aryCBs(i)).Enabled = True
Else
Application.CommandBars(aryCBs(i)).Visible = True
End If
Next i

End Sub

Private Sub Workbook_Open()
Dim oCB As CommandBar
Dim i As Long

ReDim aryCBs(0)
For Each oCB In Application.CommandBars
If oCB.Visible Then
If oCB.Name = "Worksheet Menu Bar" Then
oCb.Enabled = False
Else
oCB.Visible = False
End If
ReDim Preserve aryCBs(i)
aryCBs(i) = oCB.Name
i = i + 1
End If
Next oCB

End Sub

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Jonathan" wrote in message
...
Hi All,

I'm hoping somebody could furnish me with / point me to some VB script in

order to hide all the toolbars (including the File Menu) in Excel when I
open a particular workbook, but that doesn't leave Excel without toolbars
upon exit of that workbook.

Many thanks in anticipation,

Jonathan



 
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 a button when hiding rows fergusor Excel Discussion (Misc queries) 2 August 10th 06 02:31 PM
Toolbars dstiefe Excel Discussion (Misc queries) 2 August 3rd 05 08:52 PM
Hiding all toolbars Iain Excel Discussion (Misc queries) 3 April 21st 05 02:56 PM
toolbars George Setting up and Configuration of Excel 2 February 8th 05 04:27 AM
Hiding toolbars but keeping the Windows Menu Bar? Big Chris[_28_] Excel Programming 1 January 9th 04 08:12 PM


All times are GMT +1. The time now is 06:56 AM.

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

About Us

"It's about Microsoft Excel"