Hello, and thanks for any advice you might have for me.

I have code within an Excel file designed to save a range to PDF that we then link into our CAD files. It is nearly working perfectly except the PDF output runs past the range with extra white space below on to a second, blank page. I've tried setting the print area and turning off "ignore print area" but I don't see any effect. What I'd really like to see is the PDF output cropped to the actual range with little to no margins.

Code:

Sub SaveCodeSummaryAsPDF()
Dim exportRng As Range
Dim pdfile As String
'Setting range to be printed
Set exportRng = Range("A1:D44")
pdfile = "loadcalc.pdf"
pdfile = ThisWorkbook.Path & "\" & pdfile
exportRng.ExportAsFixedFormat Type:=xlTypePDF, _
Filename:=pdfile, _
Quality:=xlQualityStandard, _
IncludeDocProperties:=True, _
IgnorePrintAreas:=False, _ ' I have tried both settings here
OpenAfterPublish:=True
End Sub