Setting Formula Calculation Mode of Workbook with Node.js via C++

Contents
[ ]

To set the formula calculation mode in Microsoft Excel:

  1. Select Formulas and then Calculation Options.
  2. Select one of the options.

Aspose.Cells for Node.js via C++ also allows you to set the Formula Calculation Mode using FormulaSettings.getCalculationMode() mode property. You can assign it the CalcModeType enumeration which has one of the following values:

  • CalcModeType.Automatic
  • CalcModeType.AutomaticExceptTable
  • CalcModeType.Manual
const path = require("path");
const AsposeCells = require("aspose.cells.node");

// The path to the documents directory.
const dataDir = path.join(__dirname, "data");
// Create a workbook
const workbook = new AsposeCells.Workbook();

// Set the Formula Calculation Mode to Manual
workbook.getSettings().getFormulaSettings().setCalculationMode(AsposeCells.CalcModeType.Manual);

// Save the workbook
workbook.save(path.join(dataDir, "output_out.xlsx"), AsposeCells.SaveFormat.Xlsx);