asposecells.api

Represents a defined name for a range of cells.

Example:

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

Property Getters/Setters Summary
methodgetComment()
method
setComment(value)
           Gets and sets the comment of the name. Only applies for Excel 2007 or higher versions.
methodgetFullText()
Gets the name full text of the object with the scope setting.
methodisReferred()
Indicates whether this name is referred by other formulas.
methodisVisible()
method
setVisible(value)
           Indicates whether the name is visible.
methodgetR1C1RefersTo()
method
           Gets or sets a R1C1 reference of the Name.
methodgetRefersTo()
method
           Returns or sets the formula that the name is defined to refer to, beginning with an equal sign.
methodgetSheetIndex()
method
           Indicates this name belongs to Workbook or Worksheet. 0 = Global name, otherwise index to sheet (one-based)
methodgetText()
method
setText(value)
           Gets the name text of the object.
 
Method Summary
methodgetRange()
Gets the range if this name refers to a range.
methodgetRange(recalculate)
Gets the range if this name refers to a range
methodgetRange(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.
methodgetRanges()
Gets all ranges referred by this name.
methodgetRanges(recalculate)
Gets all ranges referred by this name.
methodgetReferredAreas(recalculate)
Gets all references referred by this name.
methodgetRefersTo(isR1C1, isLocal)
Get the reference of this Name.
methodgetRefersTo(isR1C1, isLocal, row, column)
Get the reference of this Name based on specified cell.
methodsetRefersTo(refersTo, isR1C1, isLocal)
Set the reference of this Name.
methodtoString()
Returns a string represents the current Range object.
 

    • Property Getters/Setters Detail

      • getComment/setComment : String 

        String getComment() / setComment(value)
        
        Gets and sets the comment of the name. Only applies for Excel 2007 or higher versions.
      • getText/setText : String 

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

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

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

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

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

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

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

      • getRefersTo

        String 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.
      • getRefersTo

        String getRefersTo(isR1C1, isLocal, row, column)
        Get the reference of this Name based on specified cell.
        Parameters:
        isR1C1: boolean - Whether the reference needs to be formatted as R1C1.
        isLocal: boolean - Whether the reference needs to be formatted by locale.
        row: int - The row index of the cell.
        column: int - The column index of the cell.
      • setRefersTo

         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

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

        Range[] getRanges()
        Gets all ranges referred by this name.
        Returns:
        All ranges.
      • getRanges

        Range[] getRanges(recalculate)
        Gets all ranges referred by this name.
        Parameters:
        recalculate: boolean - whether recalculate it if this name has been calculated before this invocation.
        Returns:
        All ranges.
      • getReferredAreas

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

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

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

        Range 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: int - The according sheet index.
        row: int - The according row index.
        column: int - The according column index
        Returns:
        The range.