title: Run-time error '9': Subscript out of range -Error
body: <p>I am running VBA in excel in order to do some web-scraping, but am coming up with this error when attempting to reach Google Chrome. How would one avoid this? I will click debug then a single line becomes highlighted...</p>
  
  <p>This is where the error pops up</p>
  
  <p><a href="https://i.stack.imgur.com/f63j2.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/f63j2.jpg" alt="This is where the error pops up"></a></p>
  
  <p>This is the highlighted line of code that must be giving the issue</p>
  
  <p><a href="https://i.stack.imgur.com/ngh86.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ngh86.jpg" alt="This is the highlighted line of code that must be giving the issue"></a></p>
  
  <p><a href="https://i.stack.imgur.com/Kr2Dw.jpg" rel="nofollow noreferrer">Full Code in this picture</a></p>
  
  <p><strong>FULL CODE BELOW:</strong></p>
  
  <pre><code>Private Sub time_sheet_filling()
  
      Dim I As Long
      Dim IE As Object
      Dim doc As Object
      Dim objElement As Object
      Dim objCollection As Object
  
      ' Create InternetExplorer Object
      Set IE = CreateObject("ChromeTab.ChromeFrame")
      IE.Visible = True
  
      ' Send the form data To URL As POST binary request
      IE.navigate "https://wistar.dispondo.net/#/login"
  
      ' Wait while IE loading...
      Do While IE.Busy
          Application.Wait DateAdd("s", 1, Now)
      Loop
  
          'Load the logon page
      Set objCollection = IE.Document.getElementsByTagName("input")
      I = 0
      While I &lt; objCollection.Length
          If objCollection(I).Name = "username" Then
              ' Set text to enter
              objCollection(I).Value = "MyUsername"
          End If
          If objCollection(I).Name = "password" Then
              ' Set text for password
              objCollection(I).Value = "MyPasword"
          End If
          If objCollection(I).Type = "submit" And objCollection(I).Name = "btnSubmit" Then ' submit button clicking
              Set objElement = objCollection(I)
          End If
          I = I + 1
      Wend
  
      objElement.Click    ' click button to load the form
  
      ' Wait while IE re-loading...
      Do While IE.Busy
          Application.Wait DateAdd("s", 1, Now)
      Loop
  
      ' Show IE
      IE.Visible = True
  Dim links, link
  Dim n, j
  Set links = IE.Document.getElementById("dgTime").getElementsByTagName("a")
  n = links.Length
  For j = 0 To n - 1 Step 2
      links(j).Click
  'I have some operations to be done will post another question for this
  
  Next
  
  
  
  End Sub
  </code></pre>