Printer Setup Dialog Box

  • Thread starter Thread starter Michael Smith
  • Start date Start date
M

Michael Smith

This works for me...but..Once I do this...

Application.Dialogs(xlDialogPrinterSetup).Show

if the user cancels the dialog box my macro fails. How can I direct the
cancel button back to a point in my macro.
 
Try what's below. This controls what happens when you press the cancel button.

res = Application.Dialogs(xlDialogPrint).Show
If res = False Then
' dialog cancelled
....[your code]
End If
 
Try this

pr = Application.Dialogs(xlDialogPrinterSetup).Show
If pr = False Then
' User cancelled
Exit Sub
End If
 
Back
Top