A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Excel » General Discussion
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

How to make a .XLTM template file default to save as .XLSM type?



 
 
Thread Tools Display Modes
  #1  
Old April 8th, 2010, 05:35 AM posted to microsoft.public.excel.misc
NZCoyote
external usenet poster
 
Posts: 1
Default 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
  #2  
Old April 8th, 2010, 06:01 AM posted to microsoft.public.excel.misc
ozgrid.com
external usenet poster
 
Posts: 328
Default 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


 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 01:40 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.