Hi guys
I am using the VBA code below which works fine but it only prints to the last used printer, instead of ALWAYS printing to PDF:
Please could you help explain what I need to modify this so that when running the vba it ALWAYS prints to printer 'Microsoft Print to PDF'?
Thank you so much in advance for reading!
I am using the VBA code below which works fine but it only prints to the last used printer, instead of ALWAYS printing to PDF:
Code:
Sub NewQuoteGenerate()
Dim sourceSheet As Worksheet
Set sourceSheet = ActiveSheet
Application.ScreenUpdating = False
Dim response As VbMsgBoxResult
With Worksheets("Dashboard")
If Len(.Range("O26").Value) = 0 Then
response = MsgBox("You have not added any caveats or assumptions!" & Chr(10) & Chr(10) & "Are you sure you want to continue?", 36, "Caveats & Assumptions")
If response = vbNo Then .Activate: .Range("O26").Select: Exit Sub
End If
End With
Sheets("Quotation").PrintOut Copies:=1, Collate:=True, IgnorePrintAreas:=False
ChDir "Z:\example\example\example\example\"
Sheets("Quotation").ExportAsFixedFormat Type:=xlTypePDF, Filename:=ActiveSheet.Name _
, Quality:=xlQualityStandard, IncludeDocProperties:=True, IgnorePrintAreas _
:=False, OpenAfterPublish:=False
MsgBox "Your quote has been generated!", vbInformation
Application.ScreenUpdating = True
Call sourceSheet.Activate
End Sub
Please could you help explain what I need to modify this so that when running the vba it ALWAYS prints to printer 'Microsoft Print to PDF'?
Thank you so much in advance for reading!