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

Excel Wisdom
Using a mouse in Excel is the work equivalent of wearing a lanyard when you first get to college
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,215,460
Messages
6,124,949
Members
449,198
Latest member
MhammadishaqKhan

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