How to set AutoRecover property of Workbook with Node.js via C++

The following code demonstrates how to use the Workbook.getAutoRecover() method. The code first reads the default value of this property, which is true; then it sets it to false and saves the workbook. Afterwards, it reads the workbook again and retrieves the value of this property, which is now false.

Node.js code to set the AutoRecover property of Workbook

const path = require("path");
const AsposeCells = require("aspose.cells.node");

// The path to the documents directory.
const dataDir = path.join(__dirname, "data");

// Create workbook object
const workbook = new AsposeCells.Workbook();

// Read AutoRecover property
console.log("AutoRecover: " + workbook.getSettings().getAutoRecover());

// Set AutoRecover property to false
workbook.getSettings().setAutoRecover(false);

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

// Read the saved workbook again
const workbook2 = new AsposeCells.Workbook(path.join(dataDir, "output_out.xlsx"));

// Read AutoRecover property
console.log("AutoRecover: " + workbook2.getSettings().getAutoRecover());

Output

Here is the console output of the above sample code.

  
AutoRecover: True  
AutoRecover: False