title: Wait for Workbook.RefreshAll() (C#)
body: <p>I want to loop through a directory (using C#) and Refresh all Excel sheets in there. I use:</p>
  
  <pre><code>Workbook.RefreshAll();
  </code></pre>
  
  <p>How can I wait for the <code>Workbook.RefreshAll()</code> statement to finish?<br><br>
  The problem is: I open <code>FileA</code>, <code>then Workbook.RefreshAll()</code> and then open <code>FileB</code> - Refresh for <code>FileA</code> is terminated. The only solution I found is to call something like </p>
  
  <pre><code>System.Threading.Thread.Sleep(20000);
  </code></pre>
  
  <p>which I found very unlovely...</p>
  
  <p>Does someone know a better way to wait?</p>