splinter1688
New Member
- Joined
- Sep 12, 2017
- Messages
- 2
I have a Macro setup that saves the worksheet as PDF and attaches to an email,
At the moment the PDF saves to desktop, however I'd like to modify the code to have the PDF save to the directory in which the Excel file is located. Any assistance would be appreciated.
At the moment the PDF saves to desktop, however I'd like to modify the code to have the PDF save to the directory in which the Excel file is located. Any assistance would be appreciated.
Code:
Title = "Transport Booking No. " & Range("C6").Value
PdfFile = CreateObject("WScript.Shell").SpecialFolders("Desktop") & "\" & Title & ".pdf"
With ActiveWorkbook.Worksheets("Booking Form")
.ExportAsFixedFormat Type:=xlTypePDF, FileName:=PdfFile, Quality:=xlQualityStandard, IncludeDocProperties:=True, IgnorePrintAreas:=False, OpenAfterPublish:=False