Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 59
Default Testing Hyperlinks

Does anyone know of a way to test that hyperlinks are working/ not broken?

Regards
Dylan Dawson
Scotland
  #2   Report Post  
Posted to microsoft.public.excel.programming
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



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 59
Default Testing Hyperlinks

Thanks for helping me with this

"Steve Yandl" wrote:

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




Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Hyperlinks: Hyperlinks change on copy/paste? Rick S. Excel Worksheet Functions 0 November 13th 07 08:19 PM
Update 2000 Excel hyperlinks to 2003 hyperlinks lonv155 Excel Worksheet Functions 4 October 25th 07 05:51 AM
How toi turn-off hyperlinks [excel]? Email hyperlinks pop up ! jacob735 Excel Discussion (Misc queries) 1 June 22nd 07 12:57 AM
Excel Hyperlinks- cell content v. hyperlinks herpetafauna Excel Discussion (Misc queries) 2 May 23rd 06 04:39 AM
Hyperlinks to =Hyperlinks formula - Challenging Electro911 Excel Programming 7 March 2nd 06 02:00 AM


All times are GMT +1. The time now is 12:35 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"