1819
02-16-2015, 11:31 AM
This simple code opens selected links in a browser:
Sub AAOpenSelectedLinks()
Dim oLink As Hyperlink
For Each oLink In Selection.Hyperlinks
oLink.Follow
Next
End Sub
However, I get "Runtime error '4198' caused at the line
oLink.Follow
and an error message "Internet site reports that the item you requested cannot be found (HTTP/ 1.0 404)" when the weblink no longer exists.
Please could you advise how to the amend the code so that if the macro finds a 404 error, it skips the link and move to the next one.
Thanks.
Sub AAOpenSelectedLinks()
Dim oLink As Hyperlink
For Each oLink In Selection.Hyperlinks
oLink.Follow
Next
End Sub
However, I get "Runtime error '4198' caused at the line
oLink.Follow
and an error message "Internet site reports that the item you requested cannot be found (HTTP/ 1.0 404)" when the weblink no longer exists.
Please could you advise how to the amend the code so that if the macro finds a 404 error, it skips the link and move to the next one.
Thanks.