title: Why can't I find elements on a page using GetElementById?
body: <p>Hello I am working on Internet Explorer automation solution using VBA. After inspecting my webpage and inspecting the element of interest to determine its ID. <code>IE.document.GetElementByID</code> method fails because the ID cannot be found. I should add that the webpage is dynamic. So I thought i should wait a bit to let the javascripts finish running. I halted the execution of the VBA code for 1 min, but that didn't help. </p>
  
  <p>I have also assigned the content of <code>.body.innerHTML</code> and <code>.body.outerHTML</code> to a text file to inspect the content but that element was nowhere to be found. I also saved as a complete webpage and looked at the html file generated with a text editor but still that element (and many more) on the page were missing.</p>
  
  <p>Edit: Sample Code Added</p>
  
  <pre><code>Sub Test_Login()
      Dim ie As InternetExplorer
      Set ie = New InternetExplorer
      ie.Navigate2 "http://www.example.com"
      Do
          If ie.ReadyState = 4 Then
          ie.Visible = True
          Exit Do
          Else
  
          DoEvents
          End If
      Loop
      Application.Wait Now + TimeSerial(0, 0, 20)
      ie.document.getElementById("commandSignIn").Click
  End Sub
  </code></pre>