LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 270
Default Close all open toolbars

Many thanks to you all - fyi I used the following referred from both
workbook_open and workbook_beforeclose.

Sub HideBars(state)
Dim cbar As CommandBar

On Error Resume Next

For Each cbar In Application.CommandBars

If state = xlOn Then

SaveSetting AppName:="myapp", section:="CommandBars",
key:=cbar.Name, Setting:=cbar.Visible
cbar.Visible = False
Application.CommandBars("Worksheet Menu Bar").Enabled = False

Else

cbar.Visible = GetSetting(AppName:="myapp",
section:="CommandBars", key:=cbar.Name)
Application.CommandBars("Worksheet Menu Bar").Enabled = True
End If
Next

On Error GoTo 0

End Sub


"Sandy" wrote in message
...
Excel 2003 & 2007.

Is it possible to check for visible toolbars in the Workbook_Open event
and have them all close.
Then in the Workbook_BeforeClose event re-open the same toolbars?

Sandy


 
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
Hide all toolbars/menu bar when open file Robin Excel Programming 8 September 16th 07 05:06 AM
Theres no toolbars, no drop-down menus when I open Excel UA Setting up and Configuration of Excel 2 June 12th 06 12:25 PM
close (hide) toolbars Anthony Excel Discussion (Misc queries) 7 June 5th 05 03:19 PM
Enable toolbars at close Pete Excel Programming 4 April 15th 04 06:34 PM


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