title: How to input a number on an Internet Explorer element?
body: <p>I am trying to input a number on an IE element (input) from Excel VBA.</p>
  <p>I am not a HTML developer, but there are some frame codes that might influence my problem.</p>
  <p>This is what I have in VBA:</p>
  <pre><code>IE.Navigate &quot;http://thisandthat/herewego.asp&quot;
             
  IE.Document.getElementsbyId(&quot;txt_cod_re_rh&quot;).Value = &quot;aaaa&quot;
  </code></pre>
  <p>Nothing happens.</p>
  <p>I also tried to get the element ID or test if VBA could see it, but it looks like VBA cannot find it on the page (tried ID and class):</p>
  <pre><code>Set element = Document.getElementByclass(&quot;select_st&quot;)
  
  ThisWorkbook.Sheets(1).Range(&quot;b1&quot;).Value = element
  </code></pre>
  <p>This is my HTML:</p>
  <pre><code>&lt;SCRIPT LANGUAGE=&quot;VBS&quot;&gt;
  smthing
  &lt;/SCRIPT&gt;
  &lt;HTML&gt;
      &lt;HEAD&gt;
          
          
      &lt;link href=&quot;../css/standard.css&quot; rel=&quot;stylesheet&quot; type=&quot;text/css&quot;&gt;
      &lt;script language=&quot;JavaScript&quot; src=&quot;include/scripts.js&quot;&gt;&lt;/script&gt;
      &lt;script language=&quot;JavaScript&quot;&gt;
          function exibeRelatorierer(server) {
  
              d = window.document.frmFilter;
  
              var cod_VP = d.cbo_VP;
              var cod_periodo = d.cbo_Periodoerer;
              var cod_re_rh = d.txt_cod_re_rh;
  
              if (cod_re_rh.value == '') {
                  cod_re_rh.value = &quot;0&quot;;
              }
  
              if (cod_periodo.value == -1) {
                  alert(&quot;Select smthing.&quot;);
              }else{
                  if (d.TC[0].checked) {
                      parent.frames['frmMain'].location = servidor234234 + &quot;RPT_CPR01884_TS&quot; + &quot;&amp;rc:Area=Toolbar&amp;rc:LinkTarget=frmMain&amp;rc:JavaScript=True&amp;rs:ClearSession=true&amp;rc:Parameters=false&quot; + &quot;&amp;COD_VP=&quot; + cod_VP.value + &quot;&amp;COD_PERIODO=&quot; + cod_periodo.value + &quot;&amp;COD_RE_RH=&quot; + cod_re_rh.value
                  } else {
                      parent.frames['frmMain'].location = servidor234234 + &quot;RPT_CPR01884_CP&quot; + &quot;&amp;rc:Area=Toolbar&amp;rc:LinkTarget=frmMain&amp;rc:JavaScript=True&amp;rs:ClearSession=true&amp;rc:Parameters=false&quot; + &quot;&amp;COD_VP=&quot; + cod_VP.value + &quot;&amp;COD_PERIODO=&quot; + cod_periodo.value + &quot;&amp;COD_RE_RH=&quot; + cod_re_rh.value
                  }
  </code></pre>
  <p>I believe this code above is messing me up trying to insert value to the txt_cod_re_rh.<br />
  I read something about a frame? Is this element on another frame? (No idea, really.)</p>
  <p>This is the code where the input box is:</p>
  <pre><code>&lt;form id=&quot;Form1&quot; name=&quot;frmFiltro&quot;&gt;
              &lt;table border=&quot;0&quot; width=&quot;100%&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot;&gt;
                  &lt;tr class=&quot;table_bhoras1&quot; height=&quot;50&quot; align=&quot;center&quot;&gt;
                       &lt;td&gt;Extração&lt;/td&gt;
                   &lt;/tr&gt;
              &lt;/table&gt;
              &lt;table id=&quot;Table3&quot; cellSpacing=&quot;0&quot; cellPadding=&quot;0&quot; width=&quot;100%&quot; border=&quot;0&quot; class=&quot;titsemlink2&quot;&gt;
                      &lt;TR class=&quot;titsemlink2&quot;&gt;
                          &lt;td&gt;
                              Inform number: 
                          &lt;/td&gt;
                          &lt;td&gt;
                              &lt;input class=&quot;select_st&quot; type=&quot;text&quot; name=&quot;txt_cod_re_rh&quot; id=&quot;txt_cod_re_rh&quot; value=&quot;&quot; /&gt;
                          &lt;/td&gt;
                      &lt;/TR&gt;
  </code></pre>