Dialog Box Cancel Button 
Author Message
 Dialog Box Cancel Button

On Fri, 1 May 1998 03:31:47 +0200 , "DENNIS D MAYO"

Quote:

>What does the cancel button do when you create an Excel VBA 5.0 Dialog Box?
>How can I program the Cancel button to cancel the input provided in the
>dialog box?  I know the O.K. button causes the Dialog Box to Close, but the
>Cancel button should cause the command to cancel but it doesn't seem to do
>anything.

The Show method returns True if the user uses OK and False if the user
uses Cancel.

Typically your code would be
If ThisWorkbook.DialogSheets("MyDialog").Show = False Then
  ' user cancelled
  MsgBox "Bye"
Else
  ' do what you want with the dialogsheet controls
End If

Bill Manville
Oxford, England
Microsoft Excel - MVP



Tue, 17 Oct 2000 03:00:00 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. Cancel Button does not cancel call from Combo Box

2. Cancel button and X button in top right corner of message box

3. cancel button in dialog sheet

4. Cancel button in User Dialog

5. Common Dialog Control Cancel Button

6. Detecting if Cancel button has been pressed on the Find dialog

7. Cancel button on Calendar Dialog form

8. Detecting Cancel button in Insert Cross Reference dialog

9. Dissable / cancel dialog box

10. open dialog box CANCEL


 
Powered by phpBB® Forum Software © phpBB Group