「オブジェクトが必要です」と表示される理由は何でしょうか。
Private Sub CommandButton3_Click()
Dim ie As InternetExplorer
Set ie = CreateObject("InternetExplorer.Application") ie.Visible = True ie.Navigate "http://www.XXXX.jp/a/auth" 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")) Set objShell = CreateObject("Shell.Application") Set ie2 = objShell.Windows(objShell.Windows.Count - 1) Dim objA As Object For Each objA In ie2.document.all.tags("A") 'ココのメッセージボックスを表示させないと、submitの部分でエラー MsgBox "Aタグテキスト名:" & objA.innerText If objA.innerText = "お知らせ" Then objA.Click Exit For End If Next Set ie = Nothing Application.Wait (Now + TimeValue("00:00:10"))
'ココの部分で、エラー「オブジェクトが必要です」と表示される。
ie2.document.forms(0).submit
Set input_Text = ie2.document.getElementsByTagName("input")(0) MsgBox input_Text.Value Set objA = Nothing
End Sub
回答1件
あなたの回答
tips
プレビュー