如何在工作表打开事件之前停止所有excels公式计算 [英] How can we stop all excels formula calculation before worksheet open event

查看:196
本文介绍了如何在工作表打开事件之前停止所有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

推荐答案

在excel 2016中,一些excel文档正在计算打开的公式。我想要停止它。但是我可以在激活工作簿之后将计算选项设置为手动,但在此之前我的公式被调用.Is 有一种方法可以延迟公式计算或者方式
在激活workook之前取消公式调用。当使用interop excel与vsto addin时,任何设置为不计算除手动之外的属性?
In excel 2016 some excel docs are calculating formulas on open .I want to stop it.But i can set calculation option to manual only after workbook is activated, but before that my formula get called.Is  there a way to delay formula calculation or way to cancel formula call before workook is activated. Any propertie that set to not calculate other than manual when using interop excel with vsto addin?


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

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆