ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   XLDialog Printer Setup (https://www.excelbanter.com/excel-programming/307904-xldialog-printer-setup.html)

Ron Crapo

XLDialog Printer Setup
 
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

Rob Bovey

XLDialog Printer Setup
 
"Ron Crapo" wrote in message
...
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 *




Ron Crapo

XLDialog Printer Setup
 
Hey, thanks Rob - that fix worked great!
Ron
-----Original Message-----
"Ron Crapo" wrote

in message
...
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 *



.



All times are GMT +1. The time now is 03:54 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com