Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Excel 2007 .xlsm file. Macro Security options not available. | Excel Discussion (Misc queries) | |||
Excel 2007 Save As xlsm by default | Excel Programming | |||
Trouble saving xlsm worbook in Excel 2007 | Excel Programming | |||
Excel 2007 xlsm and worksheet links not updatings | Excel Discussion (Misc queries) | |||
Default a workbook to save as a xlsm (macro-enabled) in 2007 | Excel Discussion (Misc queries) |