Excel template and default save name


D

Dreiding

I'm using excel 2003.
When I open my template (xlt) file via double clicking and then exit excel,
the saveas dialog is displayed using the template file name with an xls
extension as the default name.

Is there a way I can set the default name to be the content of one of the
cells in the template? I want to force the default name of the file. This
needs to work with the save, saveas and exit function.

Thanks,
- Pat
 
Ad

Advertisements

S

Sean Timmons

Select Case file_reference
Case xls
file_type = "xlNormal"
..
..
..
End Select

ActiveWorkbook.SaveAs Filename:= _
Cell_Reference, FileFormat:=file_type, _
Password:="", WriteResPassword:="", ReadOnlyRecommended:=False, _
CreateBackup:=False

Where Cell_Reference is the cell that has the file name and file_reference
is the cell holding the file type you desire. file_type is your variable to
hold the excel back-end name for your file type.
 

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

Top