[]
A NameNode stores the short name together with optional worksheet scope information and an optional WorkbookReference for external workbook references. Use this class to represent parsed names such as a workbook-scoped or worksheet-scoped name in a formula expression tree.
FormulaSyntaxTree syntaxTree = FormulaSyntaxTree.Parse("MonthName");
NameNode nameNode = (NameNode) syntaxTree.getRoot();
String name = nameNode.getName();
NameNode from the specified string.NameNode(String name,
WorkbookReference workbook,
String worksheetName,
String lastWorksheetName) NameNode from a range of sheets of the specified workbook.NameNode from a range of sheets.final Stringfinal StringgetName()final WorkbookReferencefinal Stringfinal voidsetLastWorksheetName(String value) final voidfinal voidsetWorkbook(WorkbookReference value) final voidsetWorksheetName(String value) getChildrenNameNode from the specified string. This constructor forwards null for the workbook, start worksheet, and end worksheet information.
name - The short name.NameNode from a range of sheets.This constructor forwards null as the workbook reference to NameNode(String,WorkbookReference,String,String).
name - The short name.worksheetName - The name of start worksheet.lastWorksheetName - The name of end worksheet.NameNode from a range of sheets of the specified workbook.Use this constructor to represent a defined name in a formula syntax tree when the name belongs to an external workbook and is qualified by a worksheet range.
name - The short name.workbook - The external workbook reference.worksheetName - The name of start worksheet.lastWorksheetName - The name of end worksheet.Returns the WorkbookReference associated with this NameNode when the name is qualified by an external workbook.
NameNode nameNode = new NameNode(
"SalesTotal",
WorkbookReference.FromName("Budget.xlsx"),
"Sheet1",
null
);
WorkbookReference workbookReference = nameNode.getWorkbook();
null if this name does not refer to an external workbook.Use this method to associate the name with an external workbook when the NameNode represents a workbook-qualified name in a formula syntax tree. Pass null to remove the current external workbook reference.
NameNode nameNode = new NameNode("SalesTotal", "Sheet1", "Sheet3");
WorkbookReference workbookRef = WorkbookReference.FromName("BuildingSales");
nameNode.setWorkbook(workbookRef);
value - The external workbook reference to assign, or null to clear it.Returns the starting worksheet name stored in this NameNode. Use this method to retrieve the worksheet scope of the name when the name is qualified by a worksheet or worksheet range.
NameNode nameNode = new NameNode("SalesTotal", "Sheet1", "Sheet3");
String worksheetName = nameNode.getWorksheetName();
null if no worksheet scope has been set.sets the starting worksheet name stored in this NameNode. Use this method to update the worksheet scope of the name when the name is qualified by a worksheet or worksheet range.
NameNode nameNode = new NameNode("SalesTotal", "Sheet1", "Sheet3");
nameNode.setWorksheetName("Sheet2");
value - The starting worksheet name of the name, or null if no worksheet scope has been set.Use this method to retrieve the ending worksheet name when this NameNode represents a name scoped to a range of worksheets.
NameNode nameNode = new NameNode("SalesTotal", "Sheet1", "Sheet3");
String lastWorksheetName = nameNode.getLastWorksheetName();
Use this method to set the ending worksheet name when this NameNode represents a name scoped to a range of worksheets.
NameNode nameNode = new NameNode("SalesTotal", "Sheet1", "Sheet3");
nameNode.setLastWorksheetName("Sheet4");
value - The name of the last worksheet in the range.Returns the short name stored in this NameNode.
FormulaSyntaxTree syntaxTree = FormulaSyntaxTree.Parse("MonthName");
NameNode nameNode = (NameNode) syntaxTree.getRoot();
String name = nameNode.getName();
null if no short name has been set.sets the short name stored in this NameNode.
FormulaSyntaxTree syntaxTree = FormulaSyntaxTree.Parse("MonthName");
NameNode nameNode = (NameNode) syntaxTree.getRoot();
nameNode.setName("NetSales");
String formulaText = syntaxTree.toString();
value - The short name, or null if no short name has been set.