com.aspose.cells

  • java.lang.Object
    • com.aspose.cells.Name
public class Name 
extends java.lang.Object

Represents a defined name for a range of cells.

Example:

//Instantiating a Workbook object
Workbook workbook = new Workbook();
//Accessing the first worksheet in the Excel file
Worksheet worksheet = workbook.getWorksheets().get(0);
//Creating a named range
Range 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("C:\\output.xls");

Property Getters/Setters Summary
java.lang.StringgetComment()
void
setComment(java.lang.Stringvalue)
           Gets and sets the commont of the name. Only applies for Excel 2007.
java.lang.StringgetFullText()
Gets the name full text of the object with the scope setting.
booleanisReferred()
Indicates whether this name is referred by other formulas.
booleanisVisible()
void
setVisible(booleanvalue)
           Indicates whether the name is visible.
java.lang.StringgetR1C1RefersTo()
void
setR1C1RefersTo(java.lang.Stringvalue)
           Gets or sets a R1C1 reference of the Name.
java.lang.StringgetRefersTo()
void
setRefersTo(java.lang.Stringvalue)
           Returns or sets the formula that the name is defined to refer to, beginning with an equal sign.
intgetSheetIndex()
void
setSheetIndex(intvalue)
           Indicates this name belongs to Workbook or Worksheet. 0 = Global name, otherwise index to sheet (one-based)
java.lang.StringgetText()
void
setText(java.lang.Stringvalue)
           Gets the name text of the object.
 
Method Summary
RangegetRange()
Gets the range if this name refers to a range.
RangegetRange(boolean recalculate)
Gets the range if this name refers to a range
RangegetRange(int sheetIndex, int row, int 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.
com.aspose.cells.Range[]getRanges()
Gets all ranges referred by this name.
com.aspose.cells.Range[]getRanges(boolean recalculate)
Gets all ranges referred by this name.
com.aspose.cells.ReferredArea[]getReferredAreas(boolean recalculate)
Gets all references referred by this name.
java.lang.StringgetRefersTo(boolean isR1C1, boolean isLocal)
Get the reference of this Name.
voidsetRefersTo(java.lang.String refersTo, boolean isR1C1, boolean isLocal)
Set the reference of this Name.
java.lang.StringtoString()
Returns a string represents the current Range object.
 

    • Property Getters/Setters Detail

      • getComment/setComment

        public java.lang.String getComment() / public void setComment(java.lang.String value)
        
        Gets and sets the commont of the name. Only applies for Excel 2007.
      • getText/setText

        public java.lang.String getText() / public void setText(java.lang.String value)
        
        Gets the name text of the object.
      • getFullText

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

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

        public java.lang.String getR1C1RefersTo() / public void setR1C1RefersTo(java.lang.String value)
        
        Gets or sets a R1C1 reference of the Name.
      • isReferred

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

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

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

    setComment

    public voidsetComment(java.lang.Stringvalue)
    
    Gets and sets the commont of the name. Only applies for Excel 2007.

    setText

    public voidsetText(java.lang.Stringvalue)
    
    Gets the name text of the object.

    setRefersTo

    public voidsetRefersTo(java.lang.Stringvalue)
    
    Returns or sets the formula that the name is defined to refer to, beginning with an equal sign.

    setR1C1RefersTo

    public voidsetR1C1RefersTo(java.lang.Stringvalue)
    
    Gets or sets a R1C1 reference of the Name.

    setVisible

    public voidsetVisible(booleanvalue)
    
    Indicates whether the name is visible.

    setSheetIndex

    public voidsetSheetIndex(intvalue)
    
    Indicates this name belongs to Workbook or Worksheet. 0 = Global name, otherwise index to sheet (one-based)
    • Method Detail

      • getRefersTo

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

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

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

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

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

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

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

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

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