Hello,
I have a macro which runs through a list to the end and updates a cell in the activesheet which other cells vlookup onto. For each row in the list the macro calls the sub 'Print2' to print to pdf (one pdf per item in the list):
Sub Print2()
Sheets("Scorecard").Select
ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:="C:\BMC_Scorecards\BMC_Scorecard_" & (Range("AK4").Value), _
Quality:=xlQualityStandard, IncludeDocProperties:=True, IgnorePrintAreas _
:=False, OpenAfterPublish:=False
End Sub
The cell value AK4, which forms the filename, changes as the macro moves through each row in the list.
The problem is that the second item in the list returns the Run-time error '1004': Document not saved. the document may be open, or an error may have been envountered when saving. So I can only print the first pdf.
Any thoughts?
Bookmarks