Analyzing your prompt, please hold on...
An error occurred while retrieving the results. Please refresh the page and try again.
Microsoft Excel allows users to define named ranges with two different scopes: workbook (also known as global scope) and worksheet.
Aspose.Cells for Node.js via C++ provides the same functionality as Microsoft Excel for adding workbook and worksheet scoped named ranges. When creating a worksheet scoped named range, the worksheet reference should be used in the named range to specify it as a worksheet scoped named range.
const path = require("path");
const AsposeCells = require("aspose.cells.node");
// The path to the documents directory.
const dataDir = path.join(__dirname, "data");
// Create a new Workbook object
const workbook = new AsposeCells.Workbook();
// Get first worksheet of the workbook
const sheet = workbook.getWorksheets().get(0);
// Get worksheet's cells collection
const cells = sheet.getCells();
// Create a range of Cells from Cell A1 to C10
const workbookScope = cells.createRange("A1", "C10");
// Assign the name to workbook scope named range
workbookScope.setName("workbookScope");
// Save the workbook
workbook.save(path.join(dataDir, "WorkbookScope.out.xlsx"));
const path = require("path");
const AsposeCells = require("aspose.cells.node");
// The path to the documents directory.
const dataDir = path.join(__dirname, "data");
// Create a new Workbook object
const workbook = new AsposeCells.Workbook();
// Get first worksheet of the workbook
const sheet = workbook.getWorksheets().get(0);
// Get worksheet's cells collection
const cells = sheet.getCells();
// Create a range of Cells
const localRange = cells.createRange("A1", "C10");
// Assign name to range with sheet reference
localRange.setName("Sheet1!local");
// Save the workbook
workbook.save(path.join(dataDir, "output.out.xls"));
Analyzing your prompt, please hold on...
An error occurred while retrieving the results. Please refresh the page and try again.