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 | ||
---|---|---|
method | getComment() | |
method | setComment(value) | |
Gets and sets the comment of the name. Only applies for Excel 2007 or higher versions. | ||
method | getFullText() | |
Gets the name full text of the object with the scope setting.
|
||
method | isReferred() | |
Indicates whether this name is referred by other formulas.
|
||
method | isVisible() | |
method | setVisible(value) | |
Indicates whether the name is visible. | ||
method | getR1C1RefersTo() | |
method | setR1C1RefersTo(value) | |
Gets or sets a R1C1 reference of the |
||
method | getRefersTo() | |
method | setRefersTo(value) | |
Returns or sets the formula that the name is defined to refer to, beginning with an equal sign. | ||
method | getSheetIndex() | |
method | setSheetIndex(value) | |
Indicates this name belongs to Workbook or Worksheet. 0 = Global name, otherwise index to sheet (one-based) | ||
method | getText() | |
method | setText(value) | |
Gets the name text of the object. |
Method Summary | ||
---|---|---|
method | getRange() | |
Gets the range if this name refers to a range.
|
||
method | getRange(recalculate) | |
Gets the range if this name refers to a range
|
||
method | 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.
|
||
method | getRanges() | |
Gets all ranges referred by this name.
|
||
method | getRanges(recalculate) | |
Gets all ranges referred by this name.
|
||
method | getReferredAreas(recalculate) | |
Gets all references referred by this name.
|
||
method | getRefersTo(isR1C1, isLocal) | |
Get the reference of this Name.
|
||
method | getRefersTo(isR1C1, isLocal, row, column) | |
Get the reference of this Name based on specified cell.
|
||
method | setRefersTo(refersTo, isR1C1, isLocal) | |
Set the reference of this Name.
|
||
method | toString() | |
Returns a string represents the current Range object.
|
String getComment() / setComment(value)
String getText() / setText(value)
String getFullText()
String getRefersTo() / setRefersTo(value)
String getR1C1RefersTo() / setR1C1RefersTo(value)
boolean isReferred()
boolean isVisible() / setVisible(value)
int getSheetIndex() / setSheetIndex(value)
String getRefersTo(isR1C1, isLocal)
isR1C1: boolean
- Whether the reference needs to be formatted as R1C1.isLocal: boolean
- Whether the reference needs to be formatted by locale.String getRefersTo(isR1C1, isLocal, row, column)
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(refersTo, isR1C1, isLocal)
refersTo: String
- The reference.isR1C1: boolean
- Whether the reference is R1C1 format.isLocal: boolean
- Whether the reference is locale formatted.String toString()
Range[] getRanges()
Range[] getRanges(recalculate)
recalculate: boolean
- whether recalculate it if this name has been calculated before this invocation.ReferredArea[] getReferredAreas(recalculate)
recalculate: boolean
- whether recalculate it if this name has been calculated before this invocation.Range getRange()
Range getRange(recalculate)
recalculate: boolean
- whether recalculate it if this name has been calculated before this invocation.Range getRange(sheetIndex, row, column)
sheetIndex: int
- The according sheet index.row: int
- The according row index.column: int
- The according column index