Private Sub CommandButton2_Click()
Dim ie As InternetExplorer Dim txtInput As HTMLInputElement Dim txtOutput As HTMLInputElement Set ie = CreateObject("InternetExplorer.Application") ie.Visible = True ie.Navigate "http://www.xxx.jp" Do While ie.Busy Or ie.ReadyState < READYSTATE_COMPLETE DoEvents Loop ie.document.all("login_id").Value = Range("C8") ie.document.all("password").Value = Range("C9") ie.document.forms(0).Submit Application.Wait (Now + TimeValue("00:00:05")) ie.Navigate2 "http://www.xxx.jp/next", &H800 'シェルオブジェクトを取得 Set objShell = CreateObject("Shell.Application") '新しいウィンドウのオブジェクトを取得 Set ie2 = objShell.Windows(objShell.Windows.Count - 1) Application.Wait (Now + TimeValue("00:00:05")) 'テスト用メッセージボックス 以下は問題なく表示される 'MsgBox ie2.document.getElementsByTagName("h1")(0).outerHTML 'MsgBox ie2.document.getElementsByTagName("h1").Item(0).outerHTML 'MsgBox ie2.document.all.tags("h1")(0).outerHTML
'上記を踏まえて以下をするも値が設定されない。
Dim input_Text As HTMLDocument Set input_Text = ie2.document.getElementsByTagName("input")(3).outerHTML input_Text.Value = "abc"
End Sub
何故でしょうか。
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2015/04/24 03:08