I have the following code in module 1 of my workbook:
Application.Dialogs(xlDialogPrinterSetup).Show
ActiveWorkbook.PrintOut Copies:=1, Collate:=True
This works perfectly for the users to select their printer and then print. But it also runs the second line of code even if the user hit 'cancel' on the Printer Setup dialog menu. How can I check if they clicked 'Ok' or 'Cancel' so that I can only print if they wanted to? Thanks as always.
Mark
Application.Dialogs(xlDialogPrinterSetup).Show
ActiveWorkbook.PrintOut Copies:=1, Collate:=True
This works perfectly for the users to select their printer and then print. But it also runs the second line of code even if the user hit 'cancel' on the Printer Setup dialog menu. How can I check if they clicked 'Ok' or 'Cancel' so that I can only print if they wanted to? Thanks as always.
Mark