XLDialog Printer Setup

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
 
R

Rob Bovey

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 *
 
R

Ron Crapo

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 *



.
 
Top