请参阅我的脚本以打开IE并从Excel单元格(activecell)中搜索文本。
问题 -
尝试在脚本末尾添加sendkeys但不起作用。
Sub googlesearchactivecell()
'
' Working
'
Dim MyItem As String, IE As Object, MyElements As Object
MyItem = ActiveCell.Value
Set IE = CreateObject("InternetExplorer.Application")
IE.Navigate "www.google.com"
While IE.busy = True
Wend
Set MyElements = IE.Document.GetelementsbyTagName("Input")
For Each MyLoop In MyElements
If MyLoop.Name = "q" Then MyLoop.Value = MyItem
If MyLoop.Value = "Google Search" Then: MyLoop.Click: Exit For
Next MyLoop
IE.Visible = True
End Sub