Macro does not save with Excel Template

I have created an Excel 2003 template file and a macro assigned to a toolbar button.  The macro saves the template as a CSV file (hotfile.csv) and closes the application.  The next time I open the template file (hotfile.xlt), I click on the macro button and it tells me that it can't find the hotfile.csv macro.

What happens is the macro button is re-assigned to the CSV file during the SaveAs process.  

How can I keep the macro assigned to the toolbar button in the template (Hotfile.xlt)?
BartowITAsked:
Who is Participating?
 
BartowITAuthor Commented:
It appears this is a problem with Excel?  I installed Excel 2007 the script works.  


The line that was throwing me off in 2003 is ThisWorkbook.SaveAs Filename:

0
 
karl-henrikCommented:
If i understnad your problem correctly you need to choose the Macro Enabled Template (*.xltm) option
0
 
andrewssd3Commented:
It won't be the macro enabled thing because you are on Excel 2003.  It sounds as though you are somehow saving your template file after doing the csv save as.  This should not happen if you are using the template correctly - you must open it with File...New, or right click on it and choose New - NOT Open, which opens the template itself.  You should get a new .xls file based on the template when you open it, then the underlying template won't get changed.
0
 
BartowITAuthor Commented:
My only option is to use Excel 2003 files, so xltm won't work.  

I'm sure it's sometihng in my VB, as I had a file once before that worked just fine.  I need the macro to stay with the XLT, not the CSV file.  It's quite strange.
0
 
BartowITAuthor Commented:
Installing 2007 was a work around
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.