title: Refresh the webpage, while the webpage is not loaded properly in VBA excel
body: <p>I have created a program that extracts data from website and keeps in a spreadsheet. But the major problem I am encountering is the hanging of Internet Explorer.</p>
  
  <pre><code>With ie
          .Visible = True
          .Navigate urll
          Do While .readyState &lt;&gt; 4
              Application.StatusBar = "Opening Page : " &amp; i &amp; ", Please wait..."
              DoEvents
          Loop
          Set html = .Document
  End With
  </code></pre>
  
  <p>The loop Do While sometimes sticks and never ends as the internet explorer is not able to load properly and never comes to readystate of 4. In this case I have to either refresh the page manually (keeping visibility of ie true) or I have to stop the program, and do some updates to program (locations of source and destination of data). This is pretty time consuming if every 10th webpage is keeping the loop open. </p>
  
  <p>I have one solution, i.e. during the time loop goes on the program should check about the time elapsed during the loop execution, if the loop continues for more than 50 secs, the program should suspend the current loop and start again by refreshing page. (Please let me know if you have a better logic).</p>
  
  <p>I am not able to do a correct coding for this job. Can anyone solve this...</p>