View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Zarch Zarch is offline
external usenet poster
 
Posts: 22
Default Excel 2007 Save As xlsm by default

How can I set the SaveAs dialog to default to *.xlsm by default using the
method pinched from the Excel help file? i.e.

'Create file dialog object
Set FD = Application.FileDialog(MsoFileDialogType.msoFileDi alogSaveAs)

'Set the default file name (& path)
FD.InitialFileName = Application.DefaultFilePath & "\Planning
Spreadsheet.xls"


I've tried:
' Specify macro enabled workbook for Excel 2007
If Application.Version = 12 Then FD.InitialFileName =
application.DefaultFilePath & "\Planning Spreadsheet.xlsm"

I've also tried:
Application.DefaultSaveFormat = xlOpenXMLWorkbookMacroEnabled

However it always seems to revert to the *.xlsx file type.

Do I need to rewrite using the application.Dialogs(xlDialogSaveAs)
approach?

Basically I want to save as an xls file if the Excel version is 2003 and as
an xlsm version if 2007

Has anyone else noticed Excel 2007 falling over after a while if you open a
workbook containing macros from a previous version in compatibility mode?
Seems to need saving as *.xlsm to be happy.

Many thanks,

Z