LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 15
Default Excel 2007 Save as .xlsm

In Excel 2007 I made a template with macros.

If you make a workbook from this template it will, by default, be saved as
workbook without macros (.xlsx)

I would like that the default fileformat will be .xlsm.

I made the following macro to filter the fileformats.

The problem is however that after running this macro the default Save as
dialog box is shown again (the second time without the filter).

How can I prevent that the Save as dialog box is shown twice?





Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As
Boolean)

Dim varFileName

If ActiveWorkbook.Path = "" Then

varFileName = Application.GetSaveAsFilename( _

fileFilter:="Excel workbook with macros
(*.xlsm),*.xslm,Excel workbook (*.xlsx), *.xlsx, Excel 97-2003
(*.xls),*.xls")

ActiveWorkbook.SaveAs Filename:= varFileName

End If

End Sub





Thank you, Anne


 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel 2007 .xlsm file. Macro Security options not available. JP Excel Discussion (Misc queries) 1 July 17th 08 04:04 PM
Excel 2007 Save As xlsm by default Zarch Excel Programming 1 October 29th 07 03:46 PM
Trouble saving xlsm worbook in Excel 2007 Xavier[_6_] Excel Programming 0 October 24th 07 08:30 AM
Excel 2007 xlsm and worksheet links not updatings MochaTrpl Excel Discussion (Misc queries) 0 October 9th 07 06:52 PM
Default a workbook to save as a xlsm (macro-enabled) in 2007 Razzer204 Excel Discussion (Misc queries) 3 March 21st 07 06:10 PM


All times are GMT +1. The time now is 04:03 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"