title: VBA - IE automation - .getelements
body: <p>I'm trying to enter text into an input field that has no ID.  When I inspect the element I get this:</p>
  
  <pre><code>&lt;input title="Affected Customer(s)" class="custom-input ng-pristine ng-invalid ng-invalid-required ng-touched" role="combobox" aria-expanded="false" aria-required="true" aria-owns="typeahead-78-1606" aria-autocomplete="list" required="" type="text" placeholder="Enter customer name, email, login ID or corporate ID" entity="incident" field-name="customer.loginId" potentially-required-field="" auto-focus="" typeahead="user as user.firstName + ' ' + user.lastName for user in getList('person', $viewValue)" typeahead-loading="person.isLoading" typeahead-wait-ms="500" typeahead-on-select="onCustomerSelect($model)" typeahead-template-url="views/create/custom-add-user-dropdown.html" typeahead-min-length="3" prevent-click-event="" ng-model="person.ngModel"&gt;
  </code></pre>
  
  <p>how do I reference this input field?  I have tried many ways but they all fail.  I think my understanding is lacking and hopefully a bit of help will get me on the right track.  The code I have now that tries to locate this input field is:</p>
  
  <pre><code>Sub Automate_IE_Load_Page()
  'This will load a webpage in IE
  Dim i As Long
  Dim URL As String
  Dim IE As Object
  Dim objElement As Object
  Dim objCollection As Object
  Dim aEle As HTMLLinkElement 'special object variable for an &lt;a&gt; (link) element
  
  'Create InternetExplorer Object
  Set IE = CreateObject("InternetExplorer.Application")
  
  'Set IE.Visible = True to make IE visible, or False for IE to run in the background
  IE.Visible = True
  
  'Define URL
  URL = "https://ewpg-app-1041.hydro.mb.ca/ux/smart-it/#/create/incident"
  
  'Navigate to URL
  IE.navigate URL
  
  
  
  ' Wait while IE loading...
  'IE ReadyState = 4 signifies the webpage has loaded (the first loop is set to avoid inadvertently skipping over the second loop)
  Do While IE.readyState = 4: DoEvents: Loop   'Do While
  Do Until IE.readyState = 4: DoEvents: Loop   'Do Until
  
  
  objIE.Document.getElementsByName("customer.loginId")(0).Value = "test"
  
  'click create new
  'for each &lt;a&gt; element in the collection of objects with class of 'result__a'...
  For Each aEle In objIE.Document.getElementsByName("Affected Customer(s)")
  
      '...get the href link and print it to the sheet in col C, row y
      result = aEle
  
  'repeat times the # of ele's we have in the collection
  Next
  
  
  'Unload IE
  Set IE = Nothing
  Set objElement = Nothing
  Set objCollection = Nothing
  
  End Sub
  </code></pre>
  
  <p>The line "objIE.Document.getElementsByName("customer.loginId")(0).Value = "test"" gives me the error Run-time error 424 - object expected.  </p>
  
  <p>Thank you for any help you can provide, this will probably be extremely easy but I'm just not understanding something basic obviously.  The code above was taken from a various sites, seems to work fine.  I had the for look working for testing using different logic.</p>