Mostra Formule invece di Valori in un Foglio di Lavoro con Node.js tramite C++
Contents
[
Hide
]
È possibile mostrare formule invece di valori calcolati in Microsoft Excel usando l’opzione Mostra Formule dalla scheda Formule. Quando vengono mostrate le formule, Microsoft Excel visualizza le formule nel foglio di lavoro. Puoi ottenere lo stesso risultato usando Aspose.Cells for Node.js via C++.
Aspose.Cells fornisce una proprietà Worksheet.getShowFormulas(). Impostala a true per far sì che Microsoft Excel visualizzi le formule.
const path = require("path");
const AsposeCells = require("aspose.cells.node");
// The path to the documents directory.
const dataDir = path.join(__dirname, "data");
const filePath = path.join(dataDir, "source.xlsx");
// Load the source workbook
const workbook = new AsposeCells.Workbook(filePath);
// Access the first worksheet
const worksheet = workbook.getWorksheets().get(0);
// Show formulas of the worksheet
worksheet.setShowFormulas(true);
// Save the workbook
workbook.save(path.join(dataDir, ".out.xlsx"));