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:
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