Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / New Users / January 2007

Tip: Looking for answers? Try searching our database.

Custom Toolbars and Relative Macros

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
schorley@gmail.com - 30 Jan 2007 10:12 GMT
Hi

I've made a custom toolbar, EGI, which has two buttons on it. The
toolbar is attached to the workbook.
However, the workbook is only a template workbook, so many copies of
it will be made. When this happens the toolbar buttons relate to the
original (template) workbook.

How can I make the buttons be 'relative' to the workbooks?

Thanks!
Bob Phillips - 30 Jan 2007 11:31 GMT
Assign the macros in the Workbook_Open event

Private Sub Workbook_Open()
   With Application.Commandbars("MyBar")
       .Controls("Ctl1").OnAction = "myMacro1"
       .Controls("Ctl2").OnAction = "myMacro2"
   End With
End Sub

'This is workbook event code.
'To input this code, right click on the Excel icon on the worksheet
'(or next to the File menu if you maximise your workbooks),
'select View Code from the menu, and paste the code

Signature

---
HTH

Bob

(change the xxxx to gmail if mailing direct)

> Hi
>
[quoted text clipped - 7 lines]
>
> Thanks!
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.