Node.jsとC++を使ったユニオン範囲の作成方法
Contents
[
Hide
]
ユニオン範囲の作成
Aspose.Cellsは、WorksheetCollection.createUnionRangeメソッドを使ってユニオン範囲を作成する機能を提供します。このメソッドは、ユニオン範囲を作成するアドレスとワークシートのインデックスの2つのパラメータを受け取ります。WorksheetCollection.createUnionRangeは、UnionRangeオブジェクトを返します。
以下のコードスニペットは、WorksheetCollection.createUnionRangeメソッドを使用してユニオン範囲を作成する例です。生成された出力ファイルは参考のために添付されています。
const AsposeCells = require("aspose.cells.node");
const path = require("path");
// The path to the documents directory.
const dataDir = path.join(__dirname, "data");
const filePath = path.join(dataDir, "sample.xlsx");
// Loads the workbook which contains hidden external links
const workbook = new AsposeCells.Workbook(filePath);
// Create union range
const unionRange = workbook.getWorksheets().createUnionRange("sheet1!A1:A10,sheet1!C1:C10", 0);
// Put value "ABCD" in the range
unionRange.setValue("ABCD");
// Save the output workbook.
workbook.save("CreateUnionRange_out.xlsx");