「高速回線でGoogleに3秒は待ち過ぎだし、逆に低速回線で重い画面には短すぎるケースもある……」
'サンプル4.2.2_画面遷移を待ち受ける 秒数待ちうけ
Public Sub
navigateAndSetValue()
Dim ie As
InternetExplorer
'IE起動→Googleに遷移
Set ie =
CreateObject("InternetExplorer.Application")
ie.Visible = True
ie.Navigate2
"http://www.google.co.jp/"
'待ちうけ(とりあえず3秒。通信速度等に応じて調整)
Sleep 3000
'Googleのフォームに値をセットして検索実行
ie.document.forms("f").elements("q").Value
= "ぼたもち おはぎ 違い"
ie.document.forms("f").submit
End Sub