View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.programming
Vergel Adriano Vergel Adriano is offline
external usenet poster
 
Posts: 857
Default custom toolbars to exclusive files.

Hi Nuzza,

Yes, I believe it should work if another user opens the file.

You don't really store the toolbar in the spreadsheet. But you can put code
on the spreadsheet that creates and/or displays the toolbar. The OP was
looking for a way to make a toolbar available only to one specific workbook.
If the user closes the workbook or switches to another one, he should not see
the toolbar. The OP didn't want to just hide the toolbar. It should not exist
unless the user is on the specific workbook. Thus, my suggestion was to
create the toolbar when the workbook is activated and delete the toolbar on
workbook_deactivate.

In your case, if you don't want the toolbar being deleted, you can just hide
it on the workbook_deactivate. For example:

Private Sub Workbook_Deactivate()
On Error Resume Next
Application.CommandBars("MyCommandBar").Visible=Fa lse
End Sub


--
Hope that helps.

Vergel Adriano


"Nuzza" wrote:

Thanks, this works better.

So would this work if another user accesses the file? Is there a way that I
can store the toolbar in the spreadsheet only, and not have to reference to
another toolbar? Basically, to go back to the original question of this
thread, I want this toolbar to open only in this one file and closed when the
file is closed.