问题
I have code to know the URL existence but in many other systems or may another office version it is not working. could please help me with this? Where is im doing wrong? Is there an alternate option? Thanks in advance I am using code to know URL VALIDITY is
Public Function IsURLGood(URL As String) As Boolean
Dim request As New WinHttpRequest
On Error GoTo IsURLGoodError
request.Open "HEAD", URL
request.send
If request.Status = 200 Then
IsURLGood = True
Else
IsURLGood = False
End If
Exit Function
IsURLGoodError:
IsURLGood = False
End Function
To check URL existence
If IsURLGood(Sheet1.Range("D10")) Then
'MsgBox "correct"
Else
MsgBox "URL is invalid."
End If
来源:https://stackoverflow.com/questions/58117601/vba-code-to-know-url-validity-that-will-check-whether-url-is-exist-or-not