Hi,
I have a macro in excel to save a sheet to pdf with a defined filename and location. This code have been working untill now, getting the 1004 error, document not saved.
Anyone out there who could figure this one out?
My Code:
Sub printpdf()
Application.ScreenUpdating = False
myfilenumber = CStr(ActiveSheet.Range("F2") & ActiveSheet.Range("G2"))
MyFilename = "C:\Users\......\skjema\FR\FR-" + myfilenumber + "- " + ActiveSheet.Range("E14") + ".pdf"
ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:= _
MyFilename, Quality:=xlQualityStandard, _
IncludeDocProperties:=True, IgnorePrintAreas:=False, OpenAfterPublish:= _
True
End Sub
Regards Terje
I have a macro in excel to save a sheet to pdf with a defined filename and location. This code have been working untill now, getting the 1004 error, document not saved.
Anyone out there who could figure this one out?
My Code:
Sub printpdf()
Application.ScreenUpdating = False
myfilenumber = CStr(ActiveSheet.Range("F2") & ActiveSheet.Range("G2"))
MyFilename = "C:\Users\......\skjema\FR\FR-" + myfilenumber + "- " + ActiveSheet.Range("E14") + ".pdf"
ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:= _
MyFilename, Quality:=xlQualityStandard, _
IncludeDocProperties:=True, IgnorePrintAreas:=False, OpenAfterPublish:= _
True
End Sub
Regards Terje