PC Review


Reply
Thread Tools Rate Thread

Can't find Custom Toolbar attached to workbook

 
 
=?Utf-8?B?V29vZHNtYW4=?=
Guest
Posts: n/a
 
      15th Aug 2007
I clicked 'Attach' for my custom toolbar while the relevant workbook was open
and copied it into the 'Toolbars in Workbook' window.
I then highlighted the name of this custom toolbar in Customize/Toolbars and
clicked delete, to delete it from the workspace, so that it would not show up
in other workbooks.
However, it also disappeared from the workbook where I need it, even though
in the Attach Toolbars window it is still shown in the box 'Toolbars in
Workbook'. Upon closing (and saving) and opening the workbook, it shows up
again but it also shows up in other Excel workbooks as well as in the
Customize/Toolbars listing with its box checked.
I want this toolbar to show up only in this one workbook. What am I doing
wrong?
Thanks.

 
Reply With Quote
 
 
 
 
Peter T
Guest
Posts: n/a
 
      15th Aug 2007
> I then highlighted the name of this custom toolbar in Customize/Toolbars
and
> clicked delete,


The toolbar is deleted from Excel. If it remains deleted it will be deleted
from Excel's toolbar file when Excel closes (if it existed in the file when
Excel started).

However the toolbar remains attached to your wb, when you next open it the
toolbar will be re-created and added to Excel's Toolbars. If you don't
delete it it will reappear when you next start Excel even without loading
the file it was attached to.

To do what I think you want requires a bit of help.-

In the ThisWorkbokk module (right-click the xl icon left of the File menu

Private Sub Workbook_Activate()
DoMyBar bVis:=True, bDelete:=False
End Sub

Private Sub Workbook_BeforeClose(Cancel As Boolean)
DoMyBar bVis:=False, bDelete:=True
End Sub

Private Sub Workbook_Deactivate()
DoMyBar bVis:=False, bDelete:=False
End Sub

Private Sub DoMyBar(bVis As Boolean, bDelete As Boolean)
Dim cbar As CommandBar
On Error Resume Next
Set cbar = Application.CommandBars("TestBar") 'Change "TestBar" to suit
On Error GoTo 0
If Not cbar Is Nothing Then
cbar.Visible = bVis
If bDelete Then
cbar.Delete
End If
ElseIf bVis Then
'code to create and attach the bar
End If

End Sub

Regards,
Peter T

Personaly I don't attach toolbars but recreate and destroy when the wb opens
and closes, possibly also toggle it visible in the Activate/Deactivate
events.

Regards,
Peter T


"Woodsman" <(E-Mail Removed)> wrote in message
news:F43518A5-043C-4E64-981E-(E-Mail Removed)...
> I clicked 'Attach' for my custom toolbar while the relevant workbook was

open
> and copied it into the 'Toolbars in Workbook' window.
> I then highlighted the name of this custom toolbar in Customize/Toolbars

and
> clicked delete, to delete it from the workspace, so that it would not show

up
> in other workbooks.
> However, it also disappeared from the workbook where I need it, even

though
> in the Attach Toolbars window it is still shown in the box 'Toolbars in
> Workbook'. Upon closing (and saving) and opening the workbook, it shows up
> again but it also shows up in other Excel workbooks as well as in the
> Customize/Toolbars listing with its box checked.
> I want this toolbar to show up only in this one workbook. What am I doing
> wrong?
> Thanks.
>



 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How can I update a Attached Custom Toolbar in a shared file? =?Utf-8?B?Zm9sbHltYW4=?= Microsoft Excel Worksheet Functions 1 2nd Sep 2006 03:40 AM
custom toolbar for each sheet in workbook? davegb Microsoft Excel Programming 29 19th Jan 2006 06:59 PM
Assign a Custom Toolbar to only one WorkBook Ken Soenen Microsoft Excel Discussion 3 28th Sep 2005 01:59 PM
keeping a toolbar attached to a workbook Paul James Microsoft Excel Programming 2 12th Aug 2005 11:39 PM
Re: keeping a toolbar attached to a workbook Paul Ponzelli Microsoft Excel Misc 0 12th Aug 2005 11:39 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 02:36 PM.