Hello all,
I'm working with MSXML2.XMLHTTP to iterate through a list of URLs to determine if they're still valid sites.
Here's the catch: many of these sites require client-side certificate login at the root of the URL. I want to be able to determine if the site requires the cert login, not attempt to login, then return a status saying as such. What I've got now iterates through each URL and returns the status code and it works well, but each time it hits a site requiring client certificate login, it pops up the certificate chooser. This is not feasible with over 500 sites to check on a regular basis.
In short, if the URL asks for client certificate, let me know and go on to the next URL without user interaction. Is this possible?
Thanks for all the help!
Here's what I have now:
I'm working with MSXML2.XMLHTTP to iterate through a list of URLs to determine if they're still valid sites.
Here's the catch: many of these sites require client-side certificate login at the root of the URL. I want to be able to determine if the site requires the cert login, not attempt to login, then return a status saying as such. What I've got now iterates through each URL and returns the status code and it works well, but each time it hits a site requiring client certificate login, it pops up the certificate chooser. This is not feasible with over 500 sites to check on a regular basis.
In short, if the URL asks for client certificate, let me know and go on to the next URL without user interaction. Is this possible?
Thanks for all the help!
Here's what I have now:
Code:
Sub CheckHyperlinks()
Dim oColumn As Range
Set oColumn = ActiveWorkbook.Worksheets(1).Range("B:B")
Dim oCell As Range
For Each oCell In oColumn.Cells
If oCell.Hyperlinks.Count > 0 Then
Dim oHyperlink As Hyperlink
Set oHyperlink = oCell.Hyperlinks(1) ' I assume only 1 hyperlink per cell
Dim strResult As String
strResult = GetResult(oHyperlink.Address)
oCell.Offset(0, 4).Value = strResult
End If
Next oCell
End Sub
Private Function GetResult(ByVal strUrl As String) As String
On Error GoTo ErrorHandler
Dim oHttp As New MSXML2.XMLHTTP30
oHttp.Open "HEAD", strUrl, False
oHttp.send
GetResult = oHttp.Status & " " & oHttp.statusText
Exit Function
ErrorHandler:
GetResult = "Error: " & Err.Description
End Function