默认情况下强制Excel 2007以自动计算模式打开 [英] Force excel 2007 to open in automatic calculation mode by default
问题描述
我正在excel / c#中使用excel应用程序(AddIn),遇到循环引用错误,当我通过excel选项启用自动重新计算时,该引用消失了。
但是我想在以下情况下将自动选项设置为默认值:该文件打开,但是由于某种原因,它不允许我仅将 .xlsx
文件保存为启用了自动选项。我发现一些文章指出,您必须在 XLStart
文件夹中有一个 personal.xlsx
文件,并具有所需的设置,我创建的其他工作表用作参考,默认情况下,我的所有本地excel工作表都可以使用自动选项正常工作,但该模板除外( template.xlsx
)。该模板用于填充数据,其中有29张纸。所以我不知道这是否是问题所在。
因此,现在当我打开excel时,它会先打开 personal.xlsx
,它先启用了自动选项,然后再打开模板。 xlsx
将选项更改为手动。然后,我必须每次都手动将其更改为自动选项。但是默认情况下,我PC中的所有其他 .xlsx
文件会在自动选项中打开。
I am working with excel application(AddIn) in excel/c#, getting a circular reference error which disappears when I enable automatic recalculation through excel options.
But I want to set Automatic option as default when the file opens, but for some reason it wont let me just save the .xlsx
file as automatic option enabled. I found some articles stating that you have to have a personal.xlsx
file in your XLStart
folder with the desired settings which is used by other sheets as reference, which I created and all my local excel sheets works fine with automatic option by default except this one template (template.xlsx
). The template is used to populate data and it has 29 sheets in it. So I don't know if that's creating the problem.
So now when I open excel, it opens the personal.xlsx
first which has Automatic option enabled, but then, when the template.xlsx
opens the option changes to "manual". Then I have to manually change it to Automatic option every single time. But all other .xlsx
files in my PC opens in Automatic option by default.
如何解决此问题?
推荐答案
正如我在MSDN中发现的:
As I found in MSDN :
用户可以通过Excel菜单系统或使用VBA,COM或C API以编程方式选择模式。
The user can select the mode through the Excel menu system, or programmatically using VBA, COM, or the C API.
1 ),您可以通过以下方式更改特定范围的选项:
1) You can change the option for a specific range by this:
仅使用VBA:
Range.Calculate (introduced in Excel 2000, changed in Excel 2007)
and
Range.CalculateRowMajorOrder (introduced in Excel 2007)
2)活动工作表的更改选项
按击键:: SHIFT + F9
--VBA:--
ActiveSheet.Calculate
--C API:--
xlcCalculateDocument
3)所有打开的工作簿的更改选项
按击键: F9
--VBA:--
Application.Calculate
--C API:--
xlcCalculateNow
有关更多信息,请阅读此MSDN文章
For More read this MSDN article
这篇关于默认情况下强制Excel 2007以自动计算模式打开的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!