I am coming across some issues I can't seem to figure out. I am currently using the followHyperlink call to launch all stored references to files and urls. i.e. Word documents, Excel Spreadsheets, PDFs. the problem is that if there is an error, I can't seem to be able to trap the error. Does anyone have any ideas?
M is a memo object. It has a variable URL that stores a web address. Occassionally these urls point to a PDF. If a user chooses cancel from this window an error occurs. But is not trapped. Following is my code.
Dim str As String
On Err GoTo errorHandler
'Make sure this is a viable Address call
If Left(M.URL, 7) <> "http://" Then
str = "http://" & M.URL
str = M.URL
Application.FollowHyperlink str, , True, False
MsgBox "Error trying to launch webpage. Please ensure that the URL you are trying to reach is correct", vbCritical, Error