如何在下一个选项卡上使用VBA在Google搜索上添加价值?
问题描述:
这是代码:如何在下一个选项卡上使用VBA在Google搜索上添加价值?
Sub FillinternetForm()
Dim ie As Object
Set ie = CreateObject("Internetexplorer.Application")
ie.Navigate "https://google.com"
ie.Visible = True
While ie.Busy
DoEvents 'wait until IE is done loading page.
Wend
ie.Document.all("lst-ib").Value = "Fast Sub"
ie.Navigate "https://google.com", CLng(2048)
ie.Document.all("lst-ib").Value = "Fast slow Sub"
End Sub
第一个标签工作良好,当第二次打开它无法填补这个
答
请试试这个值指南:
Sub FillinternetForm()
Dim ie As Object
Set ie = CreateObject("Internetexplorer.Application")
ie.Navigate "https://google.com"
ie.Visible = True
While ie.Busy
DoEvents 'wait until IE is done loading page.
Wend
ie.Document.getElementById("lst-ib").Value = "Fast Sub"
ie.Navigate "https://google.com", CLng(2048)
While ie.Busy
DoEvents 'wait until IE is done loading page.
Wend
With CreateObject("Shell.Application").Windows
Set ie = .Item(.Count - 1)
End With
While ie.Busy
DoEvents 'wait until IE is done loading page.
Wend
ie.Document.getElementById("lst-ib").Value = "Fast slow Sub"
End Sub
添加另一个'虽然ie.Busy'第二次导航到google.com后出现循环 – Lukas
不起作用 您可以在vba上检查自己的代码并运行其工作吗? 如果你得到答案,所以给我这里的代码谢谢 – Raulsoul