ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Excel template and default save name (https://www.excelbanter.com/excel-programming/417673-excel-template-default-save-name.html)

Dreiding

Excel template and default save name
 
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

Sean Timmons

Excel template and default save name
 
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.

"Dreiding" wrote:

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



All times are GMT +1. The time now is 12:20 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com