#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 33
Default Commandbars

I have a WB that creates both a menu and toolbar.

(1) I want to hide all other menus, shortcut menus, and toolbars when the
WB is active.

(2) I want to restore those menus and toolbars that were visible before
opening the WB upon either closing my WB or when a differant WB is selected.

Can you give me reference to accomplish this? Thanx.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Commandbars

Option Explicit


Private mFormulaBar


Private Sub Workbook_Activate()
Dim oCB As CommandBar


'Remove commandbars
For Each oCB In Application.CommandBars
oCB.Enabled = False
Next


'RemoveFormulaBar
mFormulaBar = Application.DisplayFormulaBar
Application.DisplayFormulaBar = False
End Sub


Private Sub Workbook_Deactivate()
Dim oCB As CommandBar


'Restore commandbars
For Each oCB In Application.CommandBars
oCB.Enabled = True
Next


'RestoreFormulaBar
Application.DisplayFormulaBar = mFormulaBar
End Sub


'This is workbook event code.
'To input this code, right click on the Excel icon on the worksheet
'(or next to the File menu if you maximise your workbooks),
'select View Code from the menu, and paste the code


--



--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

"PosseJohn" wrote in message
...
I have a WB that creates both a menu and toolbar.

(1) I want to hide all other menus, shortcut menus, and toolbars when the
WB is active.

(2) I want to restore those menus and toolbars that were visible before
opening the WB upon either closing my WB or when a differant WB is

selected.

Can you give me reference to accomplish this? Thanx.



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
Saving CommandBars DRA Excel Discussion (Misc queries) 0 November 21st 06 11:28 PM
Commandbars Libby Excel Programming 1 August 8th 04 07:11 PM
CommandBars garry Excel Programming 3 June 24th 04 03:12 PM
CommandBars defj Excel Programming 2 November 16th 03 12:57 AM


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