Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/314.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# Microsoft.office.interop.excel在更新页面设置时速度非常慢_C#_Excel_Office Interop_Excel Interop - Fatal编程技术网

C# Microsoft.office.interop.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

早些时候,在将数据更新到excel行时,我遇到了同样的问题(速度慢),那一次我使用了appl.screenUpdate=false。它获得了200%的速度,并在更新excel行时提高了速度。 但是,在更新页面设置时仍然很慢。 这是我的密码,你能帮我一下吗

  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有任何评论吗?谢谢你的支持。