2016-11-23 4 views
0

これはコードです: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 

最初のタブ秒のこの

+0

別 'ながらie.Busy'を追加します。あなたがgoogle.comに2回目に移動した後にループする – Lukas

+0

が動作しない あなたは自分のコードをVBAでチェックして作業を実行できますか? 答えが得られたら、ここにコードを教えてください。 – Raulsoul

答えて

0

についての値ガイドを記入していない開いたときに、これを試してくださいうまく機能:

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 
+0

あなたはそれがまだ動作していないことを確認しましたか? – Raulsoul

+0

はい、私はやって、それは働いた。しかし、私はもう一度それをテストし、時には最初のタブに2番目の検索テキストを入力することに気付きました。私は時間があるようにすぐにそれを見てください – Lukas

+0

親愛なる私は本当にこれが今すぐ私はあなたが喜んでこれを行う場合は、これが必要 – Raulsoul

関連する問題