Tony
02-07-2013, 03:36 AM
Hi all,
I use the following code to print a worksheet.
Private Sub CommandButton3_Click()
If Application.Dialogs(xlDialogPrinterSetup).Show = False Then Exit Sub
Sheets("INPUT WV").PrintOut
End Sub
I can cancel the dialogprintersetup without any error. But when i try to cancel e.g. the pdf save as dialog when i choose a pdf printer it gives me a runtime error and point to the Sheets("INPUT WV").PrintOut. When i save the pdf everything is just fine.
Regards,
I use the following code to print a worksheet.
Private Sub CommandButton3_Click()
If Application.Dialogs(xlDialogPrinterSetup).Show = False Then Exit Sub
Sheets("INPUT WV").PrintOut
End Sub
I can cancel the dialogprintersetup without any error. But when i try to cancel e.g. the pdf save as dialog when i choose a pdf printer it gives me a runtime error and point to the Sheets("INPUT WV").PrintOut. When i save the pdf everything is just fine.
Regards,