Reputation: 97
I created macro that save PDF to SharePoint library. It works for me but for end users not. When they run macro there is "error 1004. Document not saved"
I check permission in SharePoint and other things. I had this error only one time, now all the time it works for me. This is the code showed after debugging.
PrintRange.ExportAsFixedFormat Type:=xlTypePDF, FileName:= _
Sheets("Settings").Range("B2") & Sheets("Settings").Range("B1") & ".pdf", Quality:= _
xlQualityStandard, IncludeDocProperties:=True, IgnorePrintAreas:=False, _
OpenAfterPublish:=True
B2 cell is adress for SharePoint library, B1 is specific name for this file
Upvotes: 1
Views: 1252
Reputation: 23
A bit late to the party.
I had this happen to me. Turned out that I had checked out the file that my macro was trying to overwrite. Once I checked it in on SharePoint, everyone could overwrite it without any issues. Give that a try!
Upvotes: 1