Node.jsをC++経由で使用し、ワークシートで値の代わりに数式を表示する方法についての解説記事

Contents
[ ]

Aspose.CellsはWorksheet.getShowFormulas()プロパティを提供しています。これをtrueに設定すると、Microsoft Excelに数式を表示させることができます。

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"));