Save .xlsm file as .xlsx used to work but now gives 1004 error

unleashed7

New Member
Joined
Dec 12, 2023
Messages
2
Office Version
  1. 2021
Platform
  1. Windows
Hello, it's my first time here!

I'm stuck on this problem, as they updated Excel recently and can't force save file as default xlsm while it was working before for years.

VBA Code:
ActiveWorkbook.SaveAs "foo", 51

This throws a 1004 error because "VB projects and XLM Sheets cannot be saved in a macro-free workbook".
Disabling alerts also doesn't help, as this is a Run-time error not an alert.

Funny thing is it almost seems like a bug, as if I try to save the file after this error as .xlsx manually the "Save" button literally does nothing, no warning or anything, just doesn't work. I can only save as an xlsm, and if I do save it like that, close excel then REOPEN this saved fuke, suddenly the Save button works for xlsm and asks me if I want to "Save and erase features" which I do.

Is there any way to solve this?
 
That didn't work unfortunately.
Regarding my post #2, did you edit the path to match your computer ? The path shown in my post is for my computer and would not function on yours.+

I am responding late on this because the macro works fine here on my machine.

Comments ?
 
Upvote 0

Excel Facts

VLOOKUP to Left?
Use =VLOOKUP(A2,CHOOSE({1,2},$Z$1:$Z$99,$Y$1:$Y$99),2,False) to lookup Y values to left of Z values.
Comments ?
The OP's code in the first post should work now as MS have reverted back to the original dialog box now (at least on all the versions I have used recently)
 
Upvote 0

Forum statistics

Threads
1,223,888
Messages
6,175,215
Members
452,618
Latest member
Tam84

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