在线,我看到很多人完成以下代码以自动化VBA / IE搜索功能交互:
objIE.document.getElementById("id_here").Value = "Search This Text"
我已经研究了几个小时了,非常感谢任何帮助。这是我的完整代码。我会及时提供解决此问题所需的任何其他信息。
Sub InternetAutomation()
'Declaring and Setting Internet Explorer with Early Binding
Dim aExplorer As InternetExplorer
Set aExplorer = New InternetExplorer
'Set basic attributes of Internet Explorer and navigate to first webpage
With aExplorer
.Visible = True
.Navigate "www.google.com"
End With
'Wait while Internet Explorer is busy
Do While aExplorer.Busy
Application.Wait DateAdd("s", 1, Now)
Loop
'Search Parameters
aExplorer.Document.getElementById("1st - ib").Value = "Search This Text"
End Sub
答案 0 :(得分:0)
将元素更正为正确名称后,问题就解决了。
谢谢蒂姆!
关于为什么.value没有出现智能感知的任何想法?