Custom Buttons linked to Macros

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

This is fustrating...
I have made a custom menu based upon macros that I have in a worksheet. This worksheet is a file which will be saved using a different names at any given time. When I use the custom menu based upon the macros in the first saved file it works. When I go back to the "template" file and do another save as, when I try using the custom menu, it trys looking for the macros in the previous saved file instead of looking at the macros in the just saved file. Can this be fixed to where it will what ever the file name is not try and cross link to another set of macros but use the one in the file?
Any help would be great! Thanks in advance
 
Assign/unassign on open/close. Below is example for toolbar.

Sub Auto_open()
Toolbars("LogForm").Visible = True
Toolbars("LogForm").ToolbarButtons(1).OnAction = "PhoneLogger"
Toolbars("LogForm").ToolbarButtons(2).OnAction = "LateLogger"
End Sub
Sub Auto_close()
On Error Resume Next
Toolbars("LogForm").ToolbarButtons(1).OnAction = ""
Toolbars("LogForm").ToolbarButtons(2).OnAction = ""
Toolbars("LogForm").Visible = False

Toolbars("LogForm").Delete
On Error GoTo 0
End Sub

HTH, Greg

surveyorinva said:
This is fustrating...
I have made a custom menu based upon macros that I have in a worksheet.
This worksheet is a file which will be saved using a different names at any
given time. When I use the custom menu based upon the macros in the first
saved file it works. When I go back to the "template" file and do another
save as, when I try using the custom menu, it trys looking for the macros in
the previous saved file instead of looking at the macros in the just saved
file. Can this be fixed to where it will what ever the file name is not try
and cross link to another set of macros but use the one in the file?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top