Hi
can you please guide me how to execute this kind of function or how to use in excel dev.
Sub ImageExists()
Dim aPic() As Byte
Dim objWin As Object
Const strUrl As String = "http://upload.wikimedia.org/wikipedia/commons/2/22/Turkish_Van_Cat.jpg"
Dim ImageExists As Boolean
Set objWin = CreateObject("WinHttp.WinHttpRequest.5.1")
On Error Resume Next
With objWin
.Open "GET", strUrl, False
.Send
aPic = .ResponseBody
End With
Set objWin = Nothing
ImageExists = (InStr(StrConv(aPic, vbUnicode), "404 Not Found") = 0) And (Err.Number = 0)
End Sub
can you please guide me how to execute this kind of function or how to use in excel dev.
Sub ImageExists()
Dim aPic() As Byte
Dim objWin As Object
Const strUrl As String = "http://upload.wikimedia.org/wikipedia/commons/2/22/Turkish_Van_Cat.jpg"
Dim ImageExists As Boolean
Set objWin = CreateObject("WinHttp.WinHttpRequest.5.1")
On Error Resume Next
With objWin
.Open "GET", strUrl, False
.Send
aPic = .ResponseBody
End With
Set objWin = Nothing
ImageExists = (InStr(StrConv(aPic, vbUnicode), "404 Not Found") = 0) And (Err.Number = 0)
End Sub