Run Time Error 16388

  • Thread starter Thread starter Guest
  • Start date Start date
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
 
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.)
 
Back
Top