Hi VBA Gurus I am using the following code and getting the error -2147024773 (8007007b) Document not saved
Please can someone help me.
Once its sorted i need to print another range T3:Z21 and convert it to PDF and add in the above code. the above code is for page 1 and range T3:Z21 is for page 2 in the same .pdf file.
Value in AA2 = F:\FOLDER\CS\TEST\ (this is s text value)
Value in AB2 = 12102020 (this is a number ) basically i want today's date here)
I will be extremely thankful if anyone can help me.
VBA Code:
Sub Print_PDF()
Dim ThisFile As String
Dim ThisPath As String
With Worksheets("Autoclinics")
With .PageSetup
.RightFooter = "Printed on &D at &T"
.PrintQuality = 600
.CenterHorizontally = True
.CenterVertically = False
.Orientation = xlLandscape
.Draft = False
.PaperSize = xlPaperA4
End With
ThisFile = .Range("AA2").Value
ThisPath = .Range("AB2").Value
.Range("D3:R40").ExportAsFixedFormat _
Type:=xlTypePDF, _
Filename:=ThisPath & ThisFile & ".pdf", _
Quality:=xlQualityStandard, _
IncludeDocProperties:=True, _
IgnorePrintAreas:=False, _
OpenAfterPublish:=False
Application.StatusBar = False
End With
End Sub
Please can someone help me.
Once its sorted i need to print another range T3:Z21 and convert it to PDF and add in the above code. the above code is for page 1 and range T3:Z21 is for page 2 in the same .pdf file.
Value in AA2 = F:\FOLDER\CS\TEST\ (this is s text value)
Value in AB2 = 12102020 (this is a number ) basically i want today's date here)
I will be extremely thankful if anyone can help me.