2016-02-12 139 views
0

我想为Google Chrome代替IE使用下面的代码。 公用Sub GetValueFromBrowser() 昏暗即作为对象 昏暗URL作为字符串 昏暗myPoints作为字符串为Google Chrome创建对象

url = "http://localhost:8080/xyz" 
Set ie = CreateObject("InternetExplorer.Application") 

With ie 
    .Visible = 0 
    .navigate url 
    While .Busy Or .readyState <> 4 
    DoEvents 
    Wend 
End With 

Dim Doc As HTMLDocument 
Set Doc = ie.document 

myPoints = Trim(Doc.getElementsByName("points")(0).Value) 
Range("A1").Value = myPoints 

结束子

回答

0

尝试此

CreateObject("ChromeTab.ChromeFrame"); 
+0

http://stackoverflow.com/问题/ 5915325 /开放谷歌 - 铬 - 从-VBA的Excel中 –