设置工作簿的公式计算模式

Contents
[ ]

在Microsoft Excel中设置公式计算模式:

  1. 选择公式然后计算选项
  2. 选择其中一个选项。

Aspose.Cells还允许您使用FormulaSettings.CalculationMode 属性设置公式计算模式。您可以为其分配CalcModeType 枚举,该枚举具有以下值之一:

以下示例代码首先创建一个工作簿,然后将公式计算模式设置为手动,并将工作簿保存为磁盘上的输出Excel文件。

输出文件。注意公式计算模式。

todo:image_alt_text

// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-Java
// The path to the documents directory.
String dataDir = Utils.getDataDir(SetFormulaCalculationMode.class);
// Create a workbook
Workbook workbook = new Workbook();
// Set the Formula Calculation Mode to Manual
workbook.getSettings().getFormulaSettings().setCalculationMode(CalcModeType.MANUAL);
// Save the workbook
workbook.save("output.xlsx", SaveFormat.XLSX);