Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Excel 2000 Template / Macro

Status
Not open for further replies.

cobas

Programmer
Feb 4, 2002
21
GB
I feel the answer to this problem should be straight forward, but I can n't seem to solve it.

I have an Excel Template that is a blank workbook with a button that runs some VB code from a macro. Within the code I save the workbook to a specified directory for use with another application. This other application picks up the workbook and moves it to it's own internal structure.

When I try to use the template again and run the macro, I get a message saying the Macro can not be found. When I select the properties of the button and look at the assign macro option I see that the macro name is <previous filename and path>!<macro name>. This file has now been moved by the other application although the orginal macro name is available for selection.

This is driving me mad as I do n't want to have to select the assign macro option for the button every time I want to run the macro.

TIA
Colin
 
I'm not sure why this is happening, but you may have more luck if you use the button from the &quot;Controls&quot; toolbar. The code associated with this kind of object is directly connected to the worksheet code, so needs no reference to the current workbook's name.
Rob
Rob
[flowerface]
 
Thanks Rob, I'll give it a go.

Colin
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top