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: 39
Default Worksheet toolbar

The following code works perfectly on my machine. The custom toolbar
is only visible when one specific sheet is active and disappears when
I switch to another sheet or another workbook. But when the WB is
opened on someone else's machine the toolbar appears and will stay
visible when another WB is activated and then a second copy of it
appears when switching back to the original WB.

Module1

Private Sub Auto_Open()
Call CreateMyCustomToolbar
Worksheets("Database").Activate
End Sub

Public Sub CreateMyCustomToolbar()
Dim i As Long
Dim macro_names As Variant
Dim cap_names As Variant
Dim tip_text As Variant

Call Remove_ToolBars

Stuff to create tool bar goes here

End Sub

Sub Remove_ToolBars()
On Error Resume Next
Application.CommandBars("MyCustomToolbar").Delete
On Error GoTo 0
End Sub


[Sheet4(Database)Code]

Private Sub Worksheet_Activate()
CommandBars("MyCustomToolbar").Visible = True
End Sub

Private Sub Worksheet_Deactivate()
CommandBars("MyCustomToolbar").Visible = False
End Sub


[ThisWorkBook(Code)]

Private Sub Workbook_Activate()
Call CreateMyCustomToolbar
End Sub

Private Sub Workbook_Deactivate()
Call Remove_ToolBars
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
Worksheet with its own toolbar Francis Hookham Excel Programming 12 May 9th 07 12:36 PM
Forms toolbar Worksheet [email protected] Excel Discussion (Misc queries) 2 February 22nd 07 10:22 PM
Keep Custom Toolbar with Worksheet Dave Peterson Excel Programming 1 January 13th 07 11:49 PM
How do I put a toolbar button into a worksheet? Diamond1974 Excel Worksheet Functions 1 November 16th 06 01:41 PM
Keep toolbar from opening in worksheet KJ Excel Discussion (Misc queries) 2 November 9th 06 06:52 PM


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