【发布时间】:2017-11-09 02:38:10
【问题描述】:
我的代码能够与它打开的第一个网页进行交互,但是一旦我离开它,我的代码就会给我一个“424”对象所需的错误。这是一个例子。
EX:访问 yahoo.com - 搜索“地球” - 点击 Yahoo 徽标返回 yahoo 主页
Sub InternetPractice()
Dim ie As InternetExplorer
Set ie = New InternetExplorer
ie.Visible = True
ie.navigate "https://www.yahoo.com"
Do While ie.Busy = True Or ie.readyState <> 4: DoEvents: Loop
ie.document.getElementById("uh-search-box").Value = "Earth"
ie.document.getElementById("uh-search-button").Click
Do While ie.Busy = True Or ie.readyState <> 4: DoEvents: Loop
ie.document.getElementById("logo").Click
End Sub
在 Internet 上使用 VBA 对我来说是新事物,感谢任何帮助!
【问题讨论】:
标签: excel internet-explorer vba