ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   How to make a .XLTM template file default to save as .XLSM type? (https://www.excelbanter.com/excel-discussion-misc-queries/260949-how-make-xltm-template-file-default-save-xlsm-type.html)

NZCoyote

How to make a .XLTM template file default to save as .XLSM type?
 
I have a Excel 2007 macro-enabled template (.XLTM) which I use regularly.
Whenever I open this template then use save or save as to create a new file
the default workbook type of .XLSX is selected instead of .XLSM.

How can I change the default behaviour for this template to automatically
select a .XLSM format in the "Save As" dialog wihtout changing it for every
document as happens by using the 'Excel OptionsSaveSave Files in this
Format' drop down box.

Cheers

ozgrid.com

How to make a .XLTM template file default to save as .XLSM type?
 
Perhaps some code in ThisWorkbook module of the Template;

Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As
Boolean)
Dim strSaveAs As String
If SaveAsUI = True And Me.FileFormat = xlTemplate Then
Cancel = True
Application.EnableEvents = False
'Not sure of FileFilter
strSaveAs = Application.GetSaveAsFilename _
(FileFilter:="Excel Macro-Enabled Workbook(*.xlsm) *.xlsm")
Me.SaveAs strSaveAs
Application.EnableEvents = True
End If
End Sub



--
Regards
Dave Hawley
www.ozgrid.com
"NZCoyote" wrote in message
...
I have a Excel 2007 macro-enabled template (.XLTM) which I use regularly.
Whenever I open this template then use save or save as to create a new
file
the default workbook type of .XLSX is selected instead of .XLSM.

How can I change the default behaviour for this template to automatically
select a .XLSM format in the "Save As" dialog wihtout changing it for
every
document as happens by using the 'Excel OptionsSaveSave Files in this
Format' drop down box.

Cheers




All times are GMT +1. The time now is 04:47 AM.

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