Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations MikeeOK on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Common dialog cancel not working 1

Status
Not open for further replies.

CaKiwi

Programmer
Apr 8, 2001
1,294
US
When I click on the Cancel button while using the Common Dialog Control to save a file, control does not pass to the error label. Can anyone give a hint as to why?

Private Sub mnuSave_Click()

On Error GoTo err
dlgFileOpen.FileName = "tmp.dat"
dlgFileOpen.Filter = "Data (*.dat)|*.dat|All Files (*.*)|*.*"
dlgFileOpen.ShowSave
sFnam = dlgFileOpen.FileName
...

err:
End Sub

Thanks

CaKiwi

"I love mankind, it's people I can't stand" - Linus Van Pelt
 
Right click on the code window -> goto Toggle Menu ->choose Break In Class Module instead of Break On All Errors
 
Have you set dlgFileOpen.CancelError = true?
The dialog won't raise an error if this property is not set. The default is false.

Take Care

Matt
If at first you don't succeed, skydiving is not for you.
 
mattKnight,

I think you have cracked this one. I'll try it tonight and let you know.

CaKiwi

"I love mankind, it's people I can't stand" - Linus Van Pelt
 
mattKnight,

That was it. Thanks.

CaKiwi

"I love mankind, it's people I can't stand" - Linus Van Pelt
 
CaKiwi,

Thank you, its nice to be appreciated!

Take Care

Matt
If at first you don't succeed, skydiving is not for you.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top