LOt.DataBodyRange.Value = TR
WshExclPDF.ResetAllPageBreaks
If LR > 40 Then WshExclPDF.HPageBreaks.Add Before:=LOt.HeaderRowRange.Offset(LR + 1)
' Application.EnableEvents = False
' Do: DoEvents
Application.PrintCommunication = False
With WshExclPDF.PageSetup
.FitToPagesWide = 1
.FitToPagesTall = False
.LeftHeader = WshSumm.[U2].Value
.RightHeader = WshSumm.[D2].Value & vbLf & WshSumm.[D3].Value & vbLf & WshSumm.[D4].Value
.CenterHeader = WshSrc.Name
End With
Application.PrintCommunication = True
' Loop Until WshExclPDF.PageSetup.CenterHeader = WshSrc.Name
' Application.EnableEvents = True
WshExclPDF.ExportAsFixedFormat Type:=xlTypePDF, _
Filename:=ThisWorkbook.Path & "\Exclusion list " & WshSrc.Name & ".pdf", _
Quality:=xlQualityStandard, _
IncludeDocProperties:=True, _
IgnorePrintAreas:=False, _
OpenAfterPublish:=True