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!