Run Time Error 16388

G

Guest

Good day.

I have a event that on double click do the following. please see below. If I
cancel the event I recieve an Microsoft Visual Basic error and it asks me to
End or Debug My coding is limited and need some help. I know I have to write
a trap but not sure how to write it to stop this from happening. Any help
would be appreciated.


Private Sub FileDesc_DblClick(Cancel As Integer)

Application.FollowHyperlink (FilePath)

End Sub
 
A

Allen Browne

Add error handling to your procedure to trap and ignore the error.

If error handling is new, see:
Error Handling in VBA
at:
http://allenbrowne.com/ser-23a.html

BTW, I would have expected error 2501 if the link was cancelled.

If you are desparate, you could use:
On Error Resume Next
to just ignore all errors. I don't recommend that though: it masks other
problems (such as when FilePath is invalid.)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top