XLDialog Printer Setup

  • Thread starter Thread starter Ron Crapo
  • Start date Start date
R

Ron Crapo

We're calling Application.Dialogs
(xlDialogPrinterSetup).Show and want to test whether
the "Cancel" button was clicked by the user. How do we do
that?

Ron
 
Ron Crapo said:
We're calling Application.Dialogs
(xlDialogPrinterSetup).Show and want to test whether
the "Cancel" button was clicked by the user. How do we do
that?

Hi Ron,

Here's one way:

Sub ShowPrinterDialog()
Dim bResult As Boolean
bResult = Application.Dialogs(xlDialogPrinterSetup).Show
If bResult Then
''' OK was clicked
Else
''' Cancel was clicked.
End If
End Sub

--
Rob Bovey, MCSE, MCSD, Excel MVP
Application Professionals
http://www.appspro.com/

* Please post all replies to this newsgroup *
* I delete all unsolicited e-mail responses *
 
Hey, thanks Rob - that fix worked great!
Ron
-----Original Message-----


Hi Ron,

Here's one way:

Sub ShowPrinterDialog()
Dim bResult As Boolean
bResult = Application.Dialogs (xlDialogPrinterSetup).Show
If bResult Then
''' OK was clicked
Else
''' Cancel was clicked.
End If
End Sub

--
Rob Bovey, MCSE, MCSD, Excel MVP
Application Professionals
http://www.appspro.com/

* Please post all replies to this newsgroup *
* I delete all unsolicited e-mail responses *



.
 
Back
Top