View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Steve Yandl Steve Yandl is offline
external usenet poster
 
Posts: 284
Default Testing Hyperlinks

Dylan,

Try something like what I have below. Hyperlinks reported as possibly
problematic should be tested manually since the subroutine will identify
things like a page that redirects as not being OK.

Sub TestHyperlinks()

Set objHTTP = CreateObject("MSXML2.XMLHTTP")

On Error Resume Next
For Each aLink In Cells.Hyperlinks
strURL = aLink.Address
objHTTP.Open "GET", strURL, False
objHTTP.Send
If objHTTP.statusText < "OK" Then
MsgBox "Possible problem with " & strURL
End If
Next aLink

Set objHTTP = Nothing
End Sub


Steve


"DDawson" wrote in message
...
Does anyone know of a way to test that hyperlinks are working/ not broken?

Regards
Dylan Dawson
Scotland