Hi,
i'm trying to write simple script to check webpage status. And i have a problem with feeding url address from active cell.
So if i put "http://google.com/" to active cell, script won't work.
if i use GetServerResponse "http://google.com/" instead, script will work.
Can some one please tell me, why url address in active cell isn't recognized properly ?
i'm trying to write simple script to check webpage status. And i have a problem with feeding url address from active cell.
Code:
Public Function GetServerResponse(url As String) As Integer
On Error Resume Next
With CreateObject("WinHttp.WinHttpRequest.5.1")
.Open "GET", url
.send
GetServerResponse = .Status
End With
Debug.Print GetServerResponse
ActiveCell.Offset(0, 1).Value = GetServerResponse
ActiveCell.Offset(1, 0).Select
End Function
Sub checkURLstatus()
'GetServerResponse "http://google.com/"
GetServerResponse ActiveCell.Value
End Sub
So if i put "http://google.com/" to active cell, script won't work.
if i use GetServerResponse "http://google.com/" instead, script will work.
Can some one please tell me, why url address in active cell isn't recognized properly ?