Run-time error '1004' when trying to SaveAs

tomlikescoffee

New Member
Joined
Jul 19, 2010
Messages
4
Dim FPath As Variant, FInfo As String
FInfo = "Excel Workbook (*.xlsx), *.xlsx"
FPath = Application.GetSaveAsFilename("Filename", FInfo)
ActiveWorkbook.SaveAs Filename:=FPath, FileFormat:=xlExcel12


The code is throwing up "Run-Time error '1004': This extension can not be used with the selected file type. Change the file extension in the File name text box or select a different file type by changing the Save as type."

I've tried msgbox on the FPath variable and it looks fine: "C:\...\Filename.xlsx"

Please help!
 

Excel Facts

Ambidextrous Undo
Undo last command with Ctrl+Z or Alt+Backspace. If you use the Undo icon in the QAT, open the drop-down arrow to undo up to 100 steps.
Thanks for the link but as far as I can see I'm already specifying the correct file format. I'm on Excel 2007 which I see corresponds to the xlExcel12 constant.
 
Upvote 0

Forum statistics

Threads
1,214,577
Messages
6,120,359
Members
448,956
Latest member
Adamsxl

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top