Private Sub Workbook_BeforePrint(Cancel As Boolean)
Cancel = True
Dim DefaultPrinter As String
Dim Tempraryprinter As String
Tempraryprinter = "Name your Printer" ' <<<<<<Or others like "Microsoft Print to PDF"
DefaultPrinter = Application.ActivePrinter
ActiveSheet.PrintOut Preview:=False, ActivePrinter:=Tempraryprinter, PrintToFile:=True, PrToFileName:=PSFileName
Cancel = False
Application.ActivePrinter = DefaultPrinter
End Sub
Thanks man but i have a problem, when i select quick print and i print, it shows again save output as...VBA Code:Private Sub Workbook_BeforePrint(Cancel As Boolean) Cancel = True Dim DefaultPrinter As String Dim Tempraryprinter As String Tempraryprinter = "Name your Printer" ' <<<<<<Or others like "Microsoft Print to PDF" DefaultPrinter = Application.ActivePrinter ActiveSheet.PrintOut Preview:=False, ActivePrinter:=Tempraryprinter, PrintToFile:=True, PrToFileName:=PSFileName Cancel = False Application.ActivePrinter = DefaultPrinter End Sub
View attachment 26075
Private Sub Workbook_Open()
Dim DefaultPrinter As String
Dim Tempraryprinter As String
Tempraryprinter = "Microsoft Print to PDF" '
Application.ActivePrinter = Tempraryprinter & " on Ne01:"
End Sub
Yeah thats work, THANKStry
VBA Code:Private Sub Workbook_Open() Dim DefaultPrinter As String Dim Tempraryprinter As String Tempraryprinter = "Microsoft Print to PDF" ' Application.ActivePrinter = Tempraryprinter & " on Ne01:" End Sub
Hi againYou are welcome
Thank you for Feedback
Private Sub Workbook_Open()
Dim DefaultPrinter As String
Dim Tempraryprinter As String
Tempraryprinter = "Microsoft Print to PDF" '
[COLOR=rgb(226, 80, 65)] Application.ActivePrinter = Tempraryprinter & " on Ne01:"[/COLOR]
End Sub