Created
March 21, 2013 17:26
-
-
Save can3p/5214873 to your computer and use it in GitHub Desktop.
chech url in vba
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Function Alive(ByVal url As String) As String | |
Dim result As String | |
Dim winHttpReq As Object | |
Set winHttpReq = CreateObject("WinHttp.WinHttpRequest.5.1") | |
winHttpReq.Open "GET", url, False | |
On Error Resume Next | |
winHttpReq.Send | |
If Err.Number = 0 Then | |
If winHttpReq.Status = "200" Then | |
Alive = "1" | |
Else | |
Alive = "0" | |
End If | |
Else | |
Alive = "0" | |
End If | |
On Error GoTo 0 | |
End Function |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment