C# Microsoft.office.interop.excel在更新页面设置时速度非常慢
早些时候,在将数据更新到excel行时,我遇到了同样的问题(速度慢),那一次我使用了appl.screenUpdate=false。它获得了200%的速度,并在更新excel行时提高了速度。 但是,在更新页面设置时仍然很慢。 这是我的密码,你能帮我一下吗C# Microsoft.office.interop.excel在更新页面设置时速度非常慢,c#,excel,office-interop,excel-interop,C#,Excel,Office Interop,Excel Interop,早些时候,在将数据更新到excel行时,我遇到了同样的问题(速度慢),那一次我使用了appl.screenUpdate=false。它获得了200%的速度,并在更新excel行时提高了速度。 但是,在更新页面设置时仍然很慢。 这是我的密码,你能帮我一下吗 ExcelApp.ScreenUpdating = false; sheettExcel.PageSetup.LeftFooter = "Test"; ExcelApp.ScreenUpdating = tr
ExcelApp.ScreenUpdating = false;
sheettExcel.PageSetup.LeftFooter = "Test";
ExcelApp.ScreenUpdating = true;
如果确实要优化代码,则需要:
Application.ScreenUpdating = False
Application.EnableEvents = False
Application.Calculation = xlCalculateManual
[YOUR CODE HERE]
Application.Calculation = xlAutomatic
Application.ScreenUpdating = True
Application.EnableEvents = True
该属性允许设置表示计算模式的
XlCalculation
值。有关更多信息,请参阅。慢到底有多慢?谢谢尤金·阿斯塔菲耶夫,我也会试试。尤金·阿斯塔菲耶夫-PowerPoint和类似的word有任何评论吗?谢谢你的支持。