Tanyaann1995
Board Regular
- Joined
- Mar 24, 2021
- Messages
- 62
- Office Version
- 2016
- Platform
- Windows
Hi,
I am using the below code to print sheet to PDF but this currently only prints it and asks for the link to save it in. Is there a way to change the below code to just directly save the PDF in the same folder after printing?
Sub pdf()
Dim strPrinterName As String
On Error Resume Next
PrinterName = "Microsoft Print to PDF"
ActiveWindow.SelectedSheets.PrintOut Copies:=1, ActivePrinter:= _
PrinterName, collate:=True
End Sub
I am using the below code to print sheet to PDF but this currently only prints it and asks for the link to save it in. Is there a way to change the below code to just directly save the PDF in the same folder after printing?
Sub pdf()
Dim strPrinterName As String
On Error Resume Next
PrinterName = "Microsoft Print to PDF"
ActiveWindow.SelectedSheets.PrintOut Copies:=1, ActivePrinter:= _
PrinterName, collate:=True
End Sub