本文介绍了如何在工作表打开事件之前停止所有excels公式计算的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们知道我们可以在工作表打开事件后设置公式计算模式

we know we can set formula calculation mode after worksheet open event only

Application.Calculation = XlCalculation.xlCalculationManual;

Application.Calculation = XlCalculation.xlCalculationManual;

some在excel 2016中本地打开的文档是在addin启动事件之前调用所有公式,工作表打开 事件是在addin启动之后所以我无法在工作表打开之前设置手动计算

some documents when opening locally in excel 2016 is calling all formulas before addin start up event, worksheet open  event is after addin start up so i can not set manual calculation before worksheet open

vsto addin开发人员如何处理这种情况?。我正在寻找是什么说excel应用程序停止所有公式计算?,我把计算手动代码放入addin启动甚至在udf自动化类连接,但这将
抛出异常,因为计算集只能在工作表打开后完成活动

How does a vsto addin developer handle this scenario?.All i am looking is something that say excel application to stop all formula calculations?, i put in calculation manual code in addin start up and even in udf automation class connect , but that will throw exception because calculation set can be done only after worksheet open event

两个代码都不起作用

  private void ThisAddInStartup(object sender,EventArgs e)

   {

  private void ThisAddInStartup(object sender, EventArgs e)
   {

Application.Calculation = XlCalculation.xlCalculationManual;

Application.Calculation = XlCalculation.xlCalculationManual;

}

  public void OnConnection(对象应用程序,ext_ConnectMode connectMode,对象addInInst,ref数组自定义)

        {

application.Calculation = XlCalculation.xlCalculationManual;

        }

  public void OnConnection(object application, ext_ConnectMode connectMode, object addInInst, ref Array custom)
        {
application.Calculation = XlCalculation.xlCalculationManual;
        }

gj

推荐答案


这篇关于如何在工作表打开事件之前停止所有excels公式计算的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-29 16:35