Hello!
I have been stuck on this issue for a while now. I have an Excel 2010 based userform which links to over 1000 PDF's stored on an internal network (filtered based on a criteria, which in turn uses the "ThisWorkbook.FollowHyperlink ****.Caption).
The trouble I'm having is verifying all the links work (as they were manually input over many hours).
Through research I managed to find code to check a "HTTP" based hyperlink is valid, can I adapt it to check an internal hyperlink?
Here is the code (credit to the author):
Unfortunately I have little experience in coding, and admittedly have relied a lot on this forum!
Thank you for your help!
I have been stuck on this issue for a while now. I have an Excel 2010 based userform which links to over 1000 PDF's stored on an internal network (filtered based on a criteria, which in turn uses the "ThisWorkbook.FollowHyperlink ****.Caption).
The trouble I'm having is verifying all the links work (as they were manually input over many hours).
Through research I managed to find code to check a "HTTP" based hyperlink is valid, can I adapt it to check an internal hyperlink?
Here is the code (credit to the author):
Code:
For Each alink In Cells.Hyperlinks
strURL = alink.Address
If Left(strURL, 4) <> "[B]http[/B]" Then
strURL = ThisWorkbook.BuiltinDocumentProperties("Hyperlink Base") & strURL
End If
Application.StatusBar = "Testing Link: " & strURL
Set objhttp = CreateObject("MSXML2.XMLHTTP")
objhttp.Open "HEAD", strURL, False
objhttp.Send
If objhttp.statustext <> "OK" Then
alink.Parent.Interior.Color = 255
End If
Next alink
Application.StatusBar = False
On Error GoTo 0
MsgBox ("Checking Complete!" & vbCrLf & vbCrLf & "Cells With Broken or Suspect Links are Highlighted in RED.")
Unfortunately I have little experience in coding, and admittedly have relied a lot on this forum!
Thank you for your help!