自动化错误“调用的对象已与其客户端断开连接”

时间:2017-11-06 06:58:57

标签: vba internet-explorer

我正在excel中创建vba sub以自动从网站获取数据。但是我坚持点击一个元素。我一直收到错误运行时错误-02147417848(80010108)。我不知道我是否错过了什么。我已经尝试过使用它的id和名字,但它也是一样的。

Sub audit()
Dim ie As Object

Set ie = CreateObject("InternetExplorer.Application")
ie.Visible = True
With ie
    .Visible = True
    .navigate "https://samplesite.com"
End With
While ie.Busy
    DoEvents
Wend
Application.Wait (Now + TimeValue("0:00:05"))
ie.document.getElementsByClassName("xxxxxxx")(0).Click // usually the error is here

End Sub

0 个答案:

没有答案
相关问题