Please help me,
how to check if Excel Workbook has been refreshed after calling a method RefreshAll().
Excel.Application EXL = new Excel.ApplicationClass();
Excel.Workbook WRKBK = EXL.Workbooks.Open(Environment.CurrentDirectory + "/XYZ.xlsx", 0, false, 5, System.Reflection.Missing.Value, System.Reflection.Missing.Value, false, System.Reflection.Missing.Value, System.Reflection.Missing.Value, true, false, System.Reflection.Missing.Value, false, false, false);
WRKBK.RefreshAll(); WRKBK.Save(); EXL.Quit();
|
This code suposed to refresh excel workbook and then save it. But the problem is that Save() method is called before RefreshAll() is finished. I don't know how to check if refresh is over :(
Please help me....
Hirendra SisodiyaPosted Apr 12, 2010, 4:39 AM
try this:
WRKBK.RefreshAll();
Application.DoEvents();
WRKBK.Save();
EXL.Quit();
thanks
Please mark as answere if it helps