I'm writing a macro which I want to run on all versions of Excel from 2000 upwards. At one point the user is asked to specify a spreadsheet to use for the macro output and I'm using a GetSaveAsFilename dialog for this. The GetSaveAsFilename set up specifies a default filename but I want the file extension to vary according to the version of Excel being used - ie save as .xls if using 2003 or earlier or as .xlsx if using 2007 or later.
Here is the vba statement as I have it:
This dialog always makes the default filename in the File name box as "ppt title list.xls" (you might be able to guess what the macro does) even when using Excel 2010. How can I alter my GetSaveAsFilename so that the default file extension is .xls for Excel 2003 and earlier and .xlsx for 2007 and later?
Grateful for advice.
Bookmarks