「兄さまの言うとおり、今回はループに入らなかったようね。実際にこの待ち受けが行われるかは、読み込む画面のサイズや通信速度、タイミングなどに依存する」
'サンプル4.2.6_フレーム内ドキュメント状態を含めて待ち受ける
Public Sub waitFrame2()
Dim ie As
InternetExplorer
'IE起動→フレーム待ちうけテスト画面に遷移
Set ie =
CreateObject("InternetExplorer.Application")
ie.Visible = True
ie.Navigate2 "http://macrogirls.net/sample/frame.html"
'待ちうけ(IE)
Do While ie.Busy Or
ie.ReadyState < READYSTATE_COMPLETE
Debug.Print ie.Busy & "/" & ie.ReadyState
DoEvents
Loop
'待ちうけ(フレーム内Document)
Do While
ie.document.frames("Frame3").document.ReadyState <>
"complete"
Debug.Print
ie.document.frames("Frame3").document.ReadyState
DoEvents
Loop
Debug.Print
ie.document.frames("Frame3").document.ReadyState
'フォームに値をセット
ie.document.frames("Frame3").document. _
forms("TargetForm").elements("TargetText").Value
= "ぼたもち おはぎ 違い"
End Sub