Open a Save As Dialog Box with a Default Xlsx File Type in Excel VBA

33 Views Asked by At

I'm looking to open a dialog box to save a workbook, but need it to default the file type to xlsx.

Using Application.GetSaveAsFilename works to open the box, but the file type just says 'All Files'. I need it to default to xlsx to reduce the opportunity for user error (location of directory and filename are not known for the purposes of this project).

If I add a FileFilter option on the end:

Application.GetSaveAsFilename(FileFilter:="Excel Files (*.xlsx), *.xlsx")

, VBA won't accept it. A bit of research shows it seems to require something like a parameter to equal the above, which starts getting complicated. I'm sure there's a much simpler answer for what I want it to do: open box with xlsx as default.

0

There are 0 best solutions below