Hi,
I am trying to make a macro that exports the current sheet as a PDF as 'invoice [cell value].pdf. I keep trying different things and am getting this error:
Run-time error '1004': Document not saved. The document may be open, or an error may have been encountered when saving.
This is my macro:
Sub Savei()
ActiveSheet.ExportAsFixedFormat _
Type:=xlTypePDF, _
Filename:="C:\invoice" & Range("G3") & ".pdf", _
Quality:=xlQualityStandard, _
IncludeDocProperties:=True, _
OpenAfterPublish:=True
End Sub
Thanks in advance

.