aspose.cells

Class Name

Represents a defined name for a range of cells.

Example:

//Instantiating a Workbook object
var workbook = new aspose.cells.Workbook();
//Accessing the first worksheet in the Excel file
var worksheet = workbook.getWorksheets().get(0);
//Creating a named range
var range = worksheet.getCells().createRange("B4", "G14");
//Setting the name of the named range
range.setName("TestRange");
//Saving the modified Excel file in default (that is Excel 2000) format
workbook.save("Book1.xls");

Property Getters/Setters Summary
functiongetComment()
function
setComment(value)
           Gets and sets the commont of the name. Only applies for Excel 2007.
functiongetFullText()
Gets the name full text of the object with the scope setting.
functionisReferred()
Indicates whether this name is referred by other formulas.
functionisVisible()
function
setVisible(value)
           Indicates whether the name is visible.
functiongetR1C1RefersTo()
function
           Gets or sets a R1C1 reference of the Name.
functiongetRefersTo()
function
           Returns or sets the formula that the name is defined to refer to, beginning with an equal sign.
functiongetSheetIndex()
function
           Indicates this name belongs to Workbook or Worksheet. 0 = Global name, otherwise index to sheet (one-based)
functiongetText()
function
setText(value)
           Gets the name text of the object.
 
Method Summary
functiongetRange()
Gets the range if this name refers to a range.
functiongetRange(recalculate)
Gets the range if this name refers to a range
functiongetRange(sheetIndex, row, column)
Gets the range if this name refers to a range. If the reference of this name is not absolute, the range may be different for different cell.
functiongetRanges()
Gets all ranges referred by this name.
functiongetRanges(recalculate)
Gets all ranges referred by this name.
functiongetReferredAreas(recalculate)
Gets all references referred by this name.
functiongetRefersTo(isR1C1, isLocal)
Get the reference of this Name.
functionsetRefersTo(refersTo, isR1C1, isLocal)
Set the reference of this Name.
functiontoString()
Returns a string represents the current Range object.
 

    • Property Getters/Setters Detail

      • getComment/setComment : String 

        function getComment() / function setComment(value)
        
        Gets and sets the commont of the name. Only applies for Excel 2007.
      • getText/setText : String 

        function getText() / function setText(value)
        
        Gets the name text of the object.
      • getFullText : String 

        function getFullText()
        
        Gets the name full text of the object with the scope setting.
      • getRefersTo/setRefersTo : String 

        function getRefersTo() / function setRefersTo(value)
        
        Returns or sets the formula that the name is defined to refer to, beginning with an equal sign.
      • getR1C1RefersTo/setR1C1RefersTo : String 

        function getR1C1RefersTo() / function setR1C1RefersTo(value)
        
        Gets or sets a R1C1 reference of the Name.
      • isReferred : boolean 

        function isReferred()
        
        Indicates whether this name is referred by other formulas.
      • isVisible/setVisible : boolean 

        function isVisible() / function setVisible(value)
        
        Indicates whether the name is visible.
      • getSheetIndex/setSheetIndex : Number 

        function getSheetIndex() / function setSheetIndex(value)
        
        Indicates this name belongs to Workbook or Worksheet. 0 = Global name, otherwise index to sheet (one-based)
    • Method Detail

      • getRefersTo

        function getRefersTo(isR1C1, isLocal)
        Get the reference of this Name.
        Parameters:
        isR1C1: boolean - Whether the reference needs to be formatted as R1C1.
        isLocal: boolean - Whether the reference needs to be formatted by locale.
      • setRefersTo

        function setRefersTo(refersTo, isR1C1, isLocal)
        Set the reference of this Name.
        Parameters:
        refersTo: String - The reference.
        isR1C1: boolean - Whether the reference is R1C1 format.
        isLocal: boolean - Whether the reference is locale formatted.
      • toString

        function toString()
        Returns a string represents the current Range object.
        Returns:
      • getRanges

        function getRanges()
        Gets all ranges referred by this name.
        Returns:
        All ranges.
      • getRanges

        function getRanges(recalculate)
        Gets all ranges referred by this name.
        Parameters:
        recalculate: boolean - whether recalcuate it if this name has been calcualted before this invocation.
        Returns:
        All ranges.
      • getReferredAreas

        function getReferredAreas(recalculate)
        Gets all references referred by this name.
        Parameters:
        recalculate: boolean - whether recalcuate it if this name has been calcualted before this invocation.
        Returns:
        All ranges.
      • getRange

        function getRange()
        Gets the range if this name refers to a range.
        Returns:
        The range.
      • getRange

        function getRange(recalculate)
        Gets the range if this name refers to a range
        Parameters:
        recalculate: boolean - whether recalcuate it if this name has been calcualted before this invocation.
        Returns:
        The range.
      • getRange

        function getRange(sheetIndex, row, column)
        Gets the range if this name refers to a range. If the reference of this name is not absolute, the range may be different for different cell.
        Parameters:
        sheetIndex: Number - The according sheet index.
        row: Number - The according row index.
        column: Number - The according column index
        Returns:
        The range.