Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 24
Default Command Bar show/hide/delete

Quick question:

I have a custom command bar that I want to show always and only with a
specific worksheet in a specific workbook.

In "This Workbook" macro area I have

Private Sub Workbook_Activate
Application.CommandBars("MyCommandBar").Visible = True
End Sub

Private Sub Workbook_Deactivate
Application.CommandBars("MyCommandBar").Visible = False
End Sub

Private Sub Workbook_BeforeClose(Cancel As Boolean)
Application.CommandBars("MyCommandBar").Delete
End Sub

(I also have visible true/false to activate and deactivate the sheet,
but that is not where I seem to be having trouble)

Upon closing the workbook I get an error message: "Invalid Procedure
Call or Argument" that goes to the workbook_deactivate code when I hit
"debug".

But if I delete that part out then I can still see the command bar
upon opening (and activating) another workbook, although the error
message is gone. Help?

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
Command Button to show/hide a different worksheet Marilyn Excel Discussion (Misc queries) 1 April 22nd 09 03:37 AM
Hide Show Command Buttons Troubled User Excel Programming 1 May 2nd 07 05:41 PM
Hide command button MarcoR Excel Programming 2 May 12th 06 05:31 PM
How do I hide 5 command buttons Karoo News[_2_] Excel Programming 5 January 29th 06 08:44 PM
Hide Row command using if statement DME Excel Worksheet Functions 2 February 16th 05 03:44 PM


All times are GMT +1. The time now is 05:35 PM.

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"