title: Why isn't "get Elements By Name" working?
body: <p>I'm pretty new to programming. Can someone help me with this? It always crashes at the getElementsByName line, can't work out why..</p>
  
  <pre><code>Option Explicit
  Public Declare PtrSafe Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As LongPtr) 'For 64 Bit Systems
  
  
  Sub getVerb()
      Dim IE As Object ', objShellWindows As Object
      Dim verb As String, strWebPath As String
  
      strWebPath = "http://www.conjugation.org/"
  
      verb = "querer"
  
      'Navigate to page
      '----------------
      Set IE = CreateObject("InternetExplorer.Application")
      With IE
          .Visible = True
          .Navigate strWebPath
      End With
  
      'Wait for page
      Do While IE.Busy
          Sleep 250
          DoEvents
      Loop
  
      'Fill out
      '---------
      'Enter verb
      '&lt;input type="text" size="25" name="word"&gt;
      IE.document.getElementsByName("word")(0).Value = verb
  
      'Set to List
      '&lt;input type="radio" name="rb1" value="list"&gt;
      IE.document.getElementsByName("rb1")(0).Value = "list"
  
      'Press Button Conjugate
      '&lt;input type="submit" name="B1" value="Conjugate"&gt;
      IE.document.getElementByName("B1").Click
  
      'TODO: extract info
  
      'Exit IE
      '--------
      IE.Quit
      Set IE = Nothing
  
  End Sub
  </code></pre>