Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Hiding toolbars but keeping the Windows Menu Bar?

Hi! Thanks for looking at my message.

I'm trying to hide the toolbars on opening a workbook, but leave th
'Worksheet Menu Bar' (The menu in words....'File', 'Edit', 'View' etc)
I then want to unhide those same toolbars upon closing the workbook.

I got the following from searching past threads.....

---------------------------

Sub Auto_Open()
ShowToolbars False
End Sub

Sub Auto_Close()
ShowToolbars True
End Sub

Sub ShowToolbars(ToBeSeen As Boolean)
Dim CB As CommandBar
For Each CB In Application.CommandBars
If Not CB.Name = CommandBars.ActiveMenuBar.Name Then CB.Enabled
ToBeSeen
Next
End Sub

-------------------------------

....but it hides ALL toolbars. So Bill Manville suggested using:

----------------------------
If Not CB.Name = CommandBars.ActiveMenuBar.Name Then CB.Enabled
ToBeSeen
----------------------------

I replaced the 3rd to last line with this code but it actually hid th
Windows Menu Bar and didn't unhide it upon closing!!

Did I put it in the wrong place?

Can anyone please advise?

Many thanks

--
Message posted from http://www.ExcelForum.com

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Hiding toolbars but keeping the Windows Menu Bar?

You can use this
'Worksheet Menu Bar' = 1

Sub Testing()
Dim Ccount As Integer
For Ccount = 2 To Application.CommandBars.Count
CommandBars(Ccount).Enabled = False
Next
End Sub


--
Regards Ron de Bruin
(Win XP Pro SP-1 XL2000-2003)
www.rondebruin.nl



"Big Chris " wrote in message ...
Hi! Thanks for looking at my message.

I'm trying to hide the toolbars on opening a workbook, but leave the
'Worksheet Menu Bar' (The menu in words....'File', 'Edit', 'View' etc).
I then want to unhide those same toolbars upon closing the workbook.

I got the following from searching past threads.....

---------------------------

Sub Auto_Open()
ShowToolbars False
End Sub

Sub Auto_Close()
ShowToolbars True
End Sub

Sub ShowToolbars(ToBeSeen As Boolean)
Dim CB As CommandBar
For Each CB In Application.CommandBars
If Not CB.Name = CommandBars.ActiveMenuBar.Name Then CB.Enabled =
ToBeSeen
Next
End Sub

-------------------------------

...but it hides ALL toolbars. So Bill Manville suggested using:

----------------------------
If Not CB.Name = CommandBars.ActiveMenuBar.Name Then CB.Enabled =
ToBeSeen
----------------------------

I replaced the 3rd to last line with this code but it actually hid the
Windows Menu Bar and didn't unhide it upon closing!!

Did I put it in the wrong place?

Can anyone please advise?

Many thanks,


---
Message posted from http://www.ExcelForum.com/



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
menu and toolbars missing marzeats Excel Discussion (Misc queries) 3 November 2nd 05 05:59 PM
hide toolbars, menu bar, etc runandrun Excel Discussion (Misc queries) 0 September 22nd 05 10:16 PM
Hiding all toolbars Iain Excel Discussion (Misc queries) 3 April 21st 05 02:56 PM
Menu and toolbars are missing Victor Excel Discussion (Misc queries) 2 March 2nd 05 11:50 AM
Menu toolbars BrandonW Excel Programming 2 July 15th 03 07:54 AM


All times are GMT +1. The time now is 11:09 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"