Aşağıdaki kodda "invalid procedure call or argument" hatası veriyor.
Nerede hata yapıyorum, bulamadım.
3. kolonda İl , 4. kolonda İlçe , 5. kolonda adres bilgisi bulunmakta.
Not:Kodların çoğunluğu şu bağlantıda
https://www.exceldepo.com/konu/google-m ... ulma.4037/
Feyzullah beye aittir.
Kod: Tümünü seç
Sub kordinata_cevir()
Dim i As Long
Application.ScreenUpdating = False
Dim firstVal As String, secondVal As String, lastVal As String
firstVal = "https://www.google.com.tr/maps/place/"
Range("m1") = Time
For i = 2 To Range("e65000").End(3).Row
Set objHTTP = CreateObject("MSXML2.ServerXMLHTTP.6.0")
URL = Replace(Cells(i, 5), " daire ", "+D:")
URL = Replace(URL, " sokak ", " Sk.")
URL = Replace(URL, " no ", "+No:")
URL = Replace(URL, " mahallesi ", ",")
URL = firstVal & Replace(URL, " ", "+") & "," & Cells(i, 4) & "%2F" & Cells(i, 3)
objHTTP.Open "GET", URL, False
objHTTP.setRequestHeader "User-Agent", "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)"
objHTTP.send
a = Replace(Replace(Replace(URL, "+", " "), "https://www.google.com.tr/maps/place/", ""), "%2F", "/")
a = Replace(a, "sokak", "Sk")
txt = Replace(Split(Replace(objHTTP.responseText, "null,", ""), a)(1), ",", "+")
Set reg = CreateObject("vbscript.regexp")
reg.Global = True
reg.Pattern = "\[(\d{2}\.\d{3,7})"
If reg.test(txt) Then deger = reg.Execute(txt)(0).Submatches(0)
reg.Pattern = "\+(\d{2}\.\d{3,7})\]"
If reg.test(txt) Then deger1 = reg.Execute(txt)(2).Submatches(0)
Cells(i, 9) = deger & " , " & deger1
Next
Application.ScreenUpdating = True
Range("n1") = Time
End Sub