CarlStephens
Board Regular
- Joined
- Sep 25, 2020
- Messages
- 128
- Office Version
-
- 2016
- Platform
-
- Windows
Hello All,
I have the below code that prints to pdf and saves it in the same location as the excel file, can someone kindly advise what I would need to adjust in the FileName code for the pdf file to save in a path location that is in a cell on sheet 1, thank you.
Sub PrintVisa()
Dim FileName As String
FileName = ThisWorkbook.Path & "\Seabourn_Visa_Letter.pdf"
MsgBox "The visa letter will now save in the One Drive/Joiners Docs folder. Check the details, and then move the letter into the candidate folder before sending Email 1 (tab E1)."
Sheets(Array(12)).Copy 'it creates a new workbook containing the first three sheets
With ActiveWorkbook
.ExportAsFixedFormat xlTypePDF, FileName, , , , , , True
.Close False
End With
End Sub
I have the below code that prints to pdf and saves it in the same location as the excel file, can someone kindly advise what I would need to adjust in the FileName code for the pdf file to save in a path location that is in a cell on sheet 1, thank you.
Sub PrintVisa()
Dim FileName As String
FileName = ThisWorkbook.Path & "\Seabourn_Visa_Letter.pdf"
MsgBox "The visa letter will now save in the One Drive/Joiners Docs folder. Check the details, and then move the letter into the candidate folder before sending Email 1 (tab E1)."
Sheets(Array(12)).Copy 'it creates a new workbook containing the first three sheets
With ActiveWorkbook
.ExportAsFixedFormat xlTypePDF, FileName, , , , , , True
.Close False
End With
End Sub