delaying excel calculations during interop C#

自古美人都是妖i 提交于 2019-12-07 04:20:18

问题


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 outputs 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?


回答1:


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.



来源:https://stackoverflow.com/questions/4259701/delaying-excel-calculations-during-interop-c-sharp

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!