title: Fill in website search bar using Excel VBA
body: <p>I'm trying to make an Excel macro that inserts data into a web search form and then copies the results into a table. The web search form is not actually a "form", but a blank table  so I can't just change the input value of the form because there is none:</p>
  
  <pre><code>&lt;td valign="top"&gt;
      &lt;table border="0" cellspacing="0" cellpadding="2"&gt;
          &lt;tr&gt;
              &lt;th class="navLabelText" align="left"&gt;Order:&lt;/th&gt;
              &lt;td&gt;
                  &lt;input class="navEditField" id="opt_ordernumber_int" name="ordernumber" type="text" size="6" maxlength="6" /&gt;
              &lt;/td&gt;
          &lt;/tr&gt;
      &lt;/table&gt;
  &lt;/td&gt;
  &lt;td width="10"&gt;&amp;nbsp;&lt;/td&gt;
  </code></pre>
  
  <p>The HTML just continues with more of the same types of forms (I'm guessing coded in Java since the site is a .jsp). Is there any way that I can pass values into the blank table?</p>
  
  <p>Here's what I have so far:</p>
  
  <pre><code>Sub featurecode()
  
  Dim ie As Object
  Dim doc As HTMLDocument
  Dim links As IHTMLElementCollection
  Dim link As HTMLAnchorElement
  Dim i As Integer
  Dim found As Boolean
  Dim todaysURL As String
  
  Dim objElement As Object
  Dim objCollection As Object
  
  Set ie = CreateObject("InternetExplorer.Application")
  
  ie.Visible = True 'false
  ie.navigate "https://website.com"
  Application.StatusBar = "Loading Feature Codes"
  
  Do Until ie.readyState = IE_READYSTATE.complete: DoEvents: Loop
  
  Set doc = ie.document
  
  
  ' Find the input tag of the order form and submit button:
  Set objCollection = ie.document.getElementsByTagName("input")
  
  i = 0
  While i &lt; objCollection.Length
      If objCollection(i).Name = "ordernumber" Then
  
          ' Set text for search
          objCollection(i).Value = "655032"
  
      Else
          If objCollection(i).Type = "submit" And objCollection(i).Name = "Submit" Then
  
              ' "Search" button is found
              Set objElement = objCollection(i)
              objElement.Click
  
          End If
      End If
      i = i + 1
  Wend
  
  End Sub
  </code></pre>
  
  <p>The part that I'm having trouble with is this:</p>
  
  <pre><code>If objCollection(i).Name = "ordernumber" Then
  
      ' Set text for search
      objCollection(i).Value = "655032"
  </code></pre>
  
  <p>Usually you can change the HTML value of the form, but in this case there is no HTML value in the input tag, so I'm at a loss. My goal here is to simply insert an order number into the form and hit the submit button. Unfortunately I can't show you the website as it's an internal corporate site, but here's a screenshot of the relevant info: <a href="http://img402.imageshack.us/img402/9850/79951377.jpg" rel="nofollow">screenshot</a></p>
  
  <p>Thanks!</p>