Re: run time error occured when " Cancel' button is pressed from Open



"Ken" <Ken@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:ED5E7AA9-078B-4DEC-91DE-D03C3EE55FB3@xxxxxxxxxxxxxxxx
Hi all,

I have a form which has a common dialog control.
I am using this to display a Open dialog box. I have an error handling
routine, which is required to handle the error occurred when user presses
"Cancel" button of the dialog.

But when my program executes, and the open dialog is shown, If i press
cancel button, a run time error message by VB is displayed, with error
number, 32775.

Can any one tell me why its happening like this?

I have set the CancelError member of common dialog is TRUE. Also i have
an
error handler.

Thanks

Did you trap the error?

CommonDialog1.CancelError = True
On Error Resume Next
CommonDialog1.ShowOpen
If Err = cdlCancel Then Exit Sub 'or whatever



.