Guest_imported
New member
- Jan 1, 1970
- 0
In a commondialog how can I detect if a user pressed the cancel button? What is the error that is generated and how can I trap it?
I have:
CommonDialog1.ShowOpen
txt2 = CommonDialog1.FileName
OLE2.CreateEmbed (txt2)
Of course if the user presses cancel the 2nd line will also be read and I'll get an error because there is nothing on txt2!! How can do something like:
CommonDialog1.ShowOpen
txt2 = CommonDialog1.FileName
If user Didnt_Press_Cancel then
OLE2.CreateEmbed (txt2)
End if
I'd like to do something like this, but don't have the knowledge to do it can anyone help?
I have:
CommonDialog1.ShowOpen
txt2 = CommonDialog1.FileName
OLE2.CreateEmbed (txt2)
Of course if the user presses cancel the 2nd line will also be read and I'll get an error because there is nothing on txt2!! How can do something like:
CommonDialog1.ShowOpen
txt2 = CommonDialog1.FileName
If user Didnt_Press_Cancel then
OLE2.CreateEmbed (txt2)
End if
I'd like to do something like this, but don't have the knowledge to do it can anyone help?