Formeln statt Werte in einem Arbeitsblatt mit Node.js über C++ anzeigen
Contents
[
Hide
]
Es ist möglich, Formeln anstelle berechneter Werte in Microsoft Excel mit der Option Formeln anzeigen auf der Registerkarte Formeln anzuzeigen. Wenn Formeln angezeigt werden, zeigt Microsoft Excel die Formeln im Arbeitsblatt an. Sie können dasselbe Ergebnis mit Aspose.Cells for Node.js via C++ erzielen.
Aspose.Cells bietet eine Eigenschaft Worksheet.getShowFormulas(). Stellen Sie sie auf true ein, um Microsoft Excel anzuweisen, Formeln anzuzeigen.
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"));