optimization - Speeding Up C# App that opens multiple Excel files -
i wrote application c#. in app need open , close multiple excel files , read/write data to/from them, cause app runs slowly. method suggest speeding app ?
code sample write data excel file :
excel.worksheet excelsheet = (worksheet)(excelbook.worksheets[1]); range rng; rng = excelsheet.get_range("c2"); rng.value2 = txtname.text;
it's hard tell doing without more info. assuming doing 'something' excel files when open them might try turning off screen updating @ beginning of code.
application.screenupdating = false this can have profound impact on speed if moving lots of data between sheets or similar actions.
if leaving open user work turn on screen updating @ end of code.
application.screenupdating = true
Comments
Post a Comment