开发者

delaying excel calculations during interop C#

开发者 https://www.devze.com 2023-01-27 03:09 出处:网络
I have to input several hundred cells into an excel sheet from a C# program.Each time I set a cell or a range, excel slowly responds... presumably updating various o开发者_运维百科utputs between each

I have to input several hundred cells into an excel sheet from a C# program. Each time I set a cell or a range, excel slowly responds... presumably updating various o开发者_运维百科utputs between each input I add. Is there a way to disable calculations from my C# program, and re-enable it after I am done setting cells and ready to read the outputs?


Yes, set the Application.Calculation to xlCalculationManual, then back to xlCalculationAutomatic.

You can also consider setting Application.ScreenUpdating to false and then back to true.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号