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