View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Bob Phillips[_6_] Bob Phillips[_6_] is offline
external usenet poster
 
Posts: 11,272
Default Make toolbar buttons appear only in specific files?

something like

Private Sub Workbook_Open()

With Application.CommandBars
.Controls("Formatting").Controls("myButton").Visib le = True
.Controls("Tools").Controls("myMenu").Visible = True
End With

End Sub

Private Sub Workbook_Before(Cancel As Boolean)

With Application.CommandBars
.Controls("Formatting").Controls("myButton").Visib le = False
.Controls("Tools").Controls("myMenu").Visible = False
End With

End Sub

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Christiane " wrote in message
...
I have created macros in a workbook and I have assigned those macros to
toolbar buttons.

How can I have the buttons appear only when I open that specific
workbook?

I created a menu too, how can I have this menu appear only in that
workbook as well?

Thank you.
CHristiane


---
Message posted from http://www.ExcelForum.com/