Hi,
I've written vba code to print some ranges and include Charts. But the area is blank. The CHART properties and to allow printing.
I think the issue is in the code?
Public Sub Financia_Dashboard_PDF()
Dim strPath As String
Dim PDFfileName As String
Dim lastA As Long, _
lastF As Long, _
lastN As Long, _
lastR As Long
Dim PDFranges As Range
strTime = Format(Now(), "yyyy-mm-dd\_hhmm")
PDFfileName = "D:\Dropbox\Shared_Files\xxx.xxx\Reports\" & StrConv(ActiveSheet.Range("A2").Value & " - " & strTime & ".pdf", vbProperCase)
With ActiveSheet
lastA = .Cells(.Rows.Count, "A").End(xlUp).Row
lastF = .Cells(.Rows.Count, "F").End(xlUp).Row
lastN = .Cells(.Rows.Count, "N").End(xlUp).Row
lastR = .Cells(.Rows.Count, "R").End(xlUp).Row
Set PDFranges = .Range("A2:D" & lastA & _
",F2:L" & lastF & _
",N2:P" & lastN & _
",R2:Y" & lastR)
End With
PDFranges.ExportAsFixedFormat Type:=xlTypePDF, Filename:=PDFfileName, _
Quality:=xlQualityStandard, IncludeDocProperties:=True, IgnorePrintAreas:=False, OpenAfterPublish:=True
End Sub
I've written vba code to print some ranges and include Charts. But the area is blank. The CHART properties and to allow printing.
I think the issue is in the code?
Public Sub Financia_Dashboard_PDF()
Dim strPath As String
Dim PDFfileName As String
Dim lastA As Long, _
lastF As Long, _
lastN As Long, _
lastR As Long
Dim PDFranges As Range
strTime = Format(Now(), "yyyy-mm-dd\_hhmm")
PDFfileName = "D:\Dropbox\Shared_Files\xxx.xxx\Reports\" & StrConv(ActiveSheet.Range("A2").Value & " - " & strTime & ".pdf", vbProperCase)
With ActiveSheet
lastA = .Cells(.Rows.Count, "A").End(xlUp).Row
lastF = .Cells(.Rows.Count, "F").End(xlUp).Row
lastN = .Cells(.Rows.Count, "N").End(xlUp).Row
lastR = .Cells(.Rows.Count, "R").End(xlUp).Row
Set PDFranges = .Range("A2:D" & lastA & _
",F2:L" & lastF & _
",N2:P" & lastN & _
",R2:Y" & lastR)
End With
PDFranges.ExportAsFixedFormat Type:=xlTypePDF, Filename:=PDFfileName, _
Quality:=xlQualityStandard, IncludeDocProperties:=True, IgnorePrintAreas:=False, OpenAfterPublish:=True
End Sub