Hey, this macro should:
load URL which written + word from A2 + word from Z2 what gives us a resualt of searching in google images sth like "32925001 ceneo"
then it should find a title of this website
and put it into the right cell.
But in MsgBox I recive "Error 403 Forbidden!!!"1
What shall I do?
load URL which written + word from A2 + word from Z2 what gives us a resualt of searching in google images sth like "32925001 ceneo"
then it should find a title of this website
and put it into the right cell.
But in MsgBox I recive "Error 403 Forbidden!!!"1
What shall I do?
Code:
Sub Znajdz_grafike()
Dim s As String
Dim title As String
Dim objHttp As Object
Set objHttp = CreateObject("MSXML2.ServerXMLHTTP")
If Right(s, 3) <> "htm" And Right(s, 4) <> "html" Then
If Right(s, 1) <> "/" Then s = s & "/"
End If
objHttp.Open "GET", "http://www.google.com/search?site=imghp&tbm=isch&source=hp&biw=1920&bih=858&q=" & Worksheets("Arkusz6").Range("A2").Text & Worksheets("Arkusz6").Range("Z2").Text, False
objHttp.Send ""
title = objHttp.ResponseText
If InStr(1, UCase(title), "<TITLE>") Then
title = Mid(title, InStr(1, UCase(title), "<TITLE>") + Len("<TITLE>"))
title = Mid(title, 1, InStr(1, UCase(title), "</TITLE>") - 1)
Else
title = ""
End If
MsgBox title
Range("X2").Value = title
End Sub