Mohak Saini
Mohak Saini

Reputation: 11

Excel error '1004' : Document not getting saved

I have a macro enabled excel file (loading large set of data) which is supposed to save a light version and a complete version of itself at one of my desktop location. This is done through referencing a cell in excel where complete path for those files are provided.

Error Image

The file was running fine for a while but all of a sudden started throwing 'Error 1004: Document not saved' on running the macro and not able to save the document. When I try to debug it, it stops at the 'ActiveWorkbook.Save' command.

ActiveWorkbook.Save

ChDir _
    SharedDriveLocation
ActiveWorkbook.SaveAs Filename:= _
    SharedDriveLocation & "Service Level Report.xlsm" _
    , FileFormat:=xlOpenXMLWorkbookMacroEnabled, CreateBackup:=False

I have already enabled all the trusted macro settings for the file. Nothing related to naming convention of file (already checked). Can someone please help understand if this could be excel version issue or something else? This file originated from someone else but I changed myself as the author of it. Assuming that has nothing to do with it.

Upvotes: 1

Views: 989

Answers (1)

Jelena P
Jelena P

Reputation: 11

Today I have had the same error. I found that in my case the file name wasn't correct. I put in full path name folder that doesn't exist.

Probably in your case is the same - incorrect Fullpath.

ActiveWorkbook.SaveAs Filename:= _
    SharedDriveLocation & "Service Level Report.xlsm"

Try to change

ActiveWorkbook.SaveAs Filename:= _
    SharedDriveLocation & "/" &  "Service Level Report.xlsm"

Upvotes: 1

Related Questions