LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default Restoring ToolBars/Commandbars

Good afternoon,

After reading through a number of questions on the newsgroup re.
hiding/restoring toolbars and commandbars. I chose the code below to use in
my VBA project. The code works find except when a user click on the x button
in the top right hand of the workbook. In this instance the workbook closes
and the commandbars/toolbars are NOT restored. Does someone know a work
around to this problem?? All ideas much appreciated.

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
 
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
Restoring izmn19 Excel Discussion (Misc queries) 2 April 13th 08 08:17 PM
Removing/restoring toolbars peter.thompson[_69_] Excel Programming 2 January 31st 06 09:03 PM
Removing and Restoring Excel toolbars peter.thompson[_31_] Excel Programming 3 January 7th 06 09:06 PM
Restoring Toolbars and Other Things PosseJohn Excel Programming 1 May 13th 05 10:51 PM
Restoring Toolbars TJV Excel Programming 0 November 20th 03 05:14 PM


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