Runtime error 424 Object required -- VBA + Internet Explorer = Web Log in
<p>I am attemting to log into a website using VBA and Internet Explorer. This is causing a Run TIme error 424 "Object Required".</p>

<p>Here is my code. Looking for your expert advise. </p>

<pre><code>Sub Website()

  Dim IE As Object, Doc As Object, UserName As Object, Password As Object, strCode As String

  Set IE = New InternetExplorerMedium
  IE.Visible = True
  IE.Navigate "http://appln.ABC.com/index.epl"

  Do While IE.ReadyState &lt;&gt; 4: DoEvents: Loop

  Set Doc = IE.Document

  Set UserName = Doc.getElementById("login_usr")
  UserName.Value = "ABCDE"

  Set Password = Doc.getElementById("login_password")
  Password.Value = "ABCDE"

  Set btnLogin = Doc.getElementById("Login")
  btnLogin.Click

End Sub
</code></pre>