Excel VBA控件IE

时间:2015-08-10 14:19:34

标签: vba internet-explorer automation

我在WiseOwl网站上找到了以下代码。我正在尝试找到一个关于如何在Googles搜索字段中输入搜索字符串的工作示例(以学习)。我一直收到调试错误462并且无法通过它。导致问题的一行是:

  ieApp.Document.getElementById("gbqfqw").Value = "Excel VBA"

我的总代码是:

Sub FillInBBCSearchForm()

Dim ieApp As New SHDocVw.InternetExplorer

ieApp.Visible = True

'go to the website of interest

ieApp.Navigate "http://www.google.co.uk"

Do While ieApp.Busy

DoEvents

Loop

'wait for page to finish loading

Do While ieApp.Busy And Not ieApp.ReadyState = READYSTATE_COMPLETE

DoEvents

Loop 

'fill in the search form

ieApp.Document.getElementById("gbqfqw").Value = "Excel"  'DEBUG ERROR HERE

'wait for page to finish loading

Do While ieApp.Busy And Not ieApp.ReadyState = READYSTATE_COMPLETE

DoEvents

Loop


End Sub

感谢任何帮助。

由于

0 个答案:

没有答案
相关问题