ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   BuiltIn dialogs value (https://www.excelbanter.com/excel-programming/430299-builtin-dialogs-value.html)

Vitalya

BuiltIn dialogs value
 

Hi all,
How can I check what button user press in builtIn dialog?
For example I want to check If user press 'Cancel' button in the Print dialog.
In MSWord i implement DocumentBeforePrint function and call:
long buttonValue = pDialog-Display(). If buttonValue == 0 - user press
"Cancel".
How can I do it in Excel.

JLGWhiz[_2_]

BuiltIn dialogs value
 

Excel is not so kind when using VBA to test the "Cancel" value. It could be
"" or it could be "False" depending on the dialog box you are testing. If
believe that in general you could use"

aVar = <DialogBoxValue
If aVar = "" Or aVar = "False" Then
'result
End If



"Vitalya" wrote in message
...
Hi all,
How can I check what button user press in builtIn dialog?
For example I want to check If user press 'Cancel' button in the Print
dialog.
In MSWord i implement DocumentBeforePrint function and call:
long buttonValue = pDialog-Display(). If buttonValue == 0 - user press
"Cancel".
How can I do it in Excel.





All times are GMT +1. The time now is 06:16 AM.

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