I have the below code and am getting a bit of a foreign Run-Time Error. The error is highlighting the last line. Any assistance to resolve would be very much appreciated.
The Run-Time Error specifically says:
Run-time error '-2147024772 (8008007b)':
Document not saved.
The Run-Time Error specifically says:
Run-time error '-2147024772 (8008007b)':
Document not saved.
VBA Code:
Sub PDFpack()
Dim inputRange As Range
Dim c As Range
Dim strFilename As String
Set inputRange = Evaluate(Range("d3").Validation.Formula1)
For Each c In inputRange
Range("d3").Value = c.Value
With Sheets("Season Summary")
.PageSetup.Orientation = xlLandscape
End With
strFilename = Sheets("Season Summary").Range("Q3") & " as at " & Format(Date, "d-mm-yyyy")
Set inputRange = Sheets("Season Summary").Range("A1:v39")
Next c
inputRange.ExportAsFixedFormat Filename:=strFilename, Type:=xlTypePDF, OpenAfterPublish:=True
End Sub