Good Afternoon all
I'm trying to convert and save a variable range, Worksheet "Data" row "R1: Z" into a PDF file, I have been trying the code below, however when I run it I'm receiving runtime error and message "Document Not Saved" with the last 4 lines of code highlighted in yellow
Could someone please point out where I am going wrong
Appreciated
jim
Sub SavePDF()
Dim wb As Workbook
Dim ws As Worksheet
Dim rng As Range
Dim Path As String
Dim FName As String
Set wb = ThisWorkbook
Set ws = wb.Worksheets("Data")
Set rng = ws.Range("R1:Z" & Cells(Rows.Count, "R").End(xlUp).Row)
Path = "H:\Administration\GDP SOP Training\PDF Reports\"
FName = ws.Range("AD1").Value & " " & Format(Now(), "dd/mm/yyyy hh:mm") & ".pdf"
rng.ExportAsFixedFormat _
Type:=xlTypePDF, _
Filename:=Path & FName, _
IgnorePrintAreas:=True
End Sub
Bookmarks