I have a macro that goes through lots of data and creates charts from it, exporting each set as a pdf. This has been working fine until recently, when it selects a specific data set it throws back a Runtime 5 error on this line of code:
ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:= _
filepath & "\" & Sheets("1MonthlyProfile").Cells(5, 31).Value & ".pdf" _
, Quality:=xlQualityStandard, IncludeDocProperties:=True, IgnorePrintAreas _
:=False, OpenAfterPublish:=False
The only thing i have changed is the contents of cell(5, 31) but that change hasn't caused any problems while looking at the other datasets. It only seems to be a problem with this specific set of data, which admittedly, doesn't actually have any data in it.
Any ideas what this might be?
ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:= _
filepath & "\" & Sheets("1MonthlyProfile").Cells(5, 31).Value & ".pdf" _
, Quality:=xlQualityStandard, IncludeDocProperties:=True, IgnorePrintAreas _
:=False, OpenAfterPublish:=False
The only thing i have changed is the contents of cell(5, 31) but that change hasn't caused any problems while looking at the other datasets. It only seems to be a problem with this specific set of data, which admittedly, doesn't actually have any data in it.
Any ideas what this might be?