title: Excel 2003 VBA code works when stepping through but not when run fully
body: <p>I found and amended Excel VBA code to open a webpage and then open a linked file.</p>
  
  <p>It works when I step through it but when it runs fully it doesn't open the file.</p>
  
  <pre><code>Sub CallWebPage()
  
  Dim URL As String
  Dim ieApp As Object
  Dim ieDoc As Object
  Dim ieForm As Object
  Dim ieObj As Object
  Dim objColl As Collection
  
  URL = "http://sdrk3020v/mi_toolbox/default.asp?query_name=spBUS_GCR_AllSchemes&amp;app_id=2&amp;FileType=csv&amp;btnRunQuery=Run+query"
  
  Set ieApp = CreateObject("InternetExplorer.Application")
  ieApp.Visible = True
  ieApp.navigate URL
  
  While ieApp.Busy
      'wait...
  Wend
  
  Set ieDoc = ieApp.Document
  For Each ele In ieApp.Document.getelementsbytagname("a")
  
      If ele.innertext = "query_1" Then
          DoEvents
          ele.Click
      End If
  Next
  
  ieApp.Quit
  End Sub
  </code></pre>