title: Filling Internet Explorer inputbox
body: <p>I read so many answers to my problem but somehow if I try to "mimic" what I see, I still am not able to do what I need.</p>
  
  <p>The problem is very simple: fill an inputbox on an opened IE page.</p>
  
  <p>Result: the code gets stuck on the line with <code>getelementbyid</code> showing runtime error 424 (object required).</p>
  
  <pre><code>Private Sub AddInfoFromIntranet()
  
  Dim ie As Object
  
  Set ie = CreateObject("internetexplorer.application")
  Application.SendKeys "{ESC}" ' I need this to ignore a prompt
  
  With ie
      .Visible = True
      .navigate "{here goes the address of my website}"
      Do Until Not .Busy And .readyState = 4
          DoEvents
      Loop
      .document.getelementbyid("Nachnamevalue").Value = "{here goes whar I want to insert}"
  End With
  
  Set ie = Nothing
  
  End Sub
  </code></pre>
  
  <p>Internet Explorer libraries were naturally imported (otherwise the "internetexplorer.application" wouldn't work.</p>
  
  <p>I am positive that the field I want to fill is called "Nachnamevalue" as from what I learned this morning  taking a look around the internet.</p>
  
  <p>The html code of my webpage (only the interesting piece) looks like this:</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
  &lt;head&gt;
  &lt;title&gt;&lt;/title&gt;
  &lt;style&gt;
      '{here there are info on the style, which i'm gonna ignore}
  &lt;/style&gt;
  &lt;/head&gt;
  &lt;body bgcolor="#ffffcc"&gt;&lt;table width="1000"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;
      &lt;form name="Suchform" action="index.cfm" method="get" target="bottom_window"&gt;
      Nachname:
          &lt;select name="Nachnamepulldown" class="font09px" onchange="wait_and_search()"&gt;  
              &lt;option value="BEGINS_WITH"&gt;beginnt mit
              &lt;option value="EQUAL"&gt;ist
              &lt;option value="CONTAINS"&gt;enthält
          &lt;/option&gt;&lt;/select&gt;
          &lt;input name="Nachnamevalue" onkeyup="wait_and_search()" type="text" size="8"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
  
      Abteilung:
          &lt;select name="Abteilungpulldown" class="font09px" onchange="wait_and_search()"&gt; 
              &lt;option value="BEGINS_WITH"&gt;beginnt mit
          &lt;option value="EQUAL"&gt;ist
          &lt;option value="CONTAINS"&gt;enthält
          &lt;/option&gt;&lt;/select&gt;
          &lt;input name="Abteilungvalue" onkeyup="wait_and_search()" type="text" size="3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
  
          &lt;input name="fuseaction" type="hidden" value="StdSearchResult"&gt;
          &lt;input type="submit" value="suchen"&gt;
          &lt;script language="JavaScript" type="text/JavaScript"&gt;
          document.Suchform.Nachnamevalue.focus();
          &lt;/script&gt;
      &lt;/form&gt;
  &lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>There is also (I don't know if it can help) an "embedded" javascript that brings results of a search up every time at least 2 characters in the "Nachnamevalue" inputbox are written.</p>
  
  <p>What am I doing wrong?</p>
  
  <p>EDIT:
  When I try to execute the Sub step-by-step, I get the following:</p>
  
  <p><code>Set Doc = ie.document</code></p>
  
  <p>? Doc
  [object HTMLDocument]
  ( in the watchlist it is an object without any variables inside )</p>