|
楼主 |
发表于 2019-2-2 11:55
|
显示全部楼层
[广告] VBA代码宝 - VBA编程加强工具 · VBA代码随查随用 · 内置多项VBA编程加强工具 ★ 免费下载 ★ ★ 使用手册★
代码如下:
Sub 高德地图()
'On Error Resume Next
Set ie = CreateObject("InternetExplorer.application")
With ie
.navigate "F:/根据地址查询经纬度-高德.htm"
.Visible = True
Do Until .ReadyState = 4
Loop
mr = [a65536].End(3).Row
For m = 2 To [a65536].End(3).Row
DoEvents
Cells(m, 2) = "": Cells(m, 3) = ""
.Document.getelementbyid("key_2").Value = Cells(m, 1)
.Document.getelementbyid("text11").Click
If m = 2 Then Application.Wait (Now + TimeValue("00:00:01"))
Application.Wait (Now + TimeValue("00:00:01"))
V = Split(.Document.getelementbyid("result").innerHTML, " ")
Cells(m, 4) = V(0)
Cells(m, 5) = V(1)
Next
End With
ie.Quit
End Sub
|
评分
-
4
查看全部评分
-
|