「いろいろなやり方があると思うけど、2日目に学習した
起動済みInternetExplorer取得処理を再利用した」
'サンプル5.1.2_連続画面遷移(開いた子画面の待ちうけ)
Public Sub waitChild()
Dim ie As
InternetExplorer
Dim ieChild As
InternetExplorer
'IE起動→サンプル親画面に遷移
Set ie =
CreateObject("InternetExplorer.Application")
ie.Visible = True
ie.Navigate2
"http://macrogirls.net/sample/parent.html"
'待ちうけ
Do While ie.Busy Or
ie.ReadyState < READYSTATE_COMPLETE
DoEvents
Loop
'子画面を開くボタンをクリック
ie.document.forms("TargetForm").elements("OpenChild").Click
'子画面を探す
Do While ieChild Is
Nothing
Set
ieChild = Day2.getIE("子画面の例")
DoEvents
Loop
'子画面の待ちうけ(ただしgetIEでDocumentを参照しており、基本的には不要)
Do While ieChild.Busy Or
ieChild.ReadyState < READYSTATE_COMPLETE
DoEvents
Loop
Debug.Print
ieChild.document.body.innerHTML
End Sub