Problem saving new file over old

dcoledc

Active Member
Joined
May 6, 2010
Messages
403
I have some code where I save a file. On the first save, there is no problem, but when I go to save it again, using the same name, I get an error. This is only happening in Excel 2010. All other versions seems to work fine.

The error I get is 1004.

The only thing I can see that might be the problem is that when I look at the properties of the folder I am saving the file to, the read-only box is not checked but is darkened. Not sure how it got this way to begin with as I have set no attributes to the folder.

Here is part of the code:

Code:
If ThisWorkbook.Saved = False And ActiveWorkbook.Name <> "Report.xlsm" Then
    ThisFile = Range("d10").Value + ", " + Range("j10") + " " + Format(Range("q10"), "mm-dd-yy")
Application.DisplayAlerts = False
ThisWorkbook.SaveAs FileName:=ThisFile, FileFormat:=52
End If
 

Excel Facts

Waterfall charts in Excel?
Office 365 customers have access to Waterfall charts since late 2016. They were added to Excel 2019.

Forum statistics

Threads
1,224,561
Messages
6,179,521
Members
452,923
Latest member
JackiG

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