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 commont of the name. Only applies for Excel 2007. | ||
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 | setRefersTo(refersTo, isR1C1, isLocal) | |
Set the reference of this Name. | ||
method | toString() | |
Returns a string represents the current Range object. |
Property Getters/Setters Detail |
---|
getComment/setComment : String | |
String getComment() / setComment(value) |
getText/setText : String | |
String getText() / setText(value) |
getFullText : String | |
String getFullText() |
getRefersTo/setRefersTo : String | |
String getRefersTo() / setRefersTo(value) |
getR1C1RefersTo/setR1C1RefersTo : String | |
String getR1C1RefersTo() / setR1C1RefersTo(value) |
isReferred : boolean | |
boolean isReferred() |
isVisible/setVisible : boolean | |
boolean isVisible() / setVisible(value) |
getSheetIndex/setSheetIndex : int | |
int getSheetIndex() / setSheetIndex(value) |
Method Detail |
---|
getRefersTo | |
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.setRefersTo | |
setRefersTo(refersTo, isR1C1, isLocal) |
refersTo: String
- The reference.isR1C1: boolean
- Whether the reference is R1C1 format.isLocal: boolean
- Whether the reference is locale formatted.toString | |
String toString() |
getRanges | |
Range[] getRanges() |
getRanges | |
Range[] getRanges(recalculate) |
recalculate: boolean
- whether recalcuate it if this name has been calcualted before this invocation.getReferredAreas | |
ReferredArea[] getReferredAreas(recalculate) |
recalculate: boolean
- whether recalcuate it if this name has been calcualted before this invocation.getRange | |
Range getRange() |
getRange | |
Range getRange(recalculate) |
recalculate: boolean
- whether recalcuate it if this name has been calcualted before this invocation.getRange | |
Range getRange(sheetIndex, row, column) |
sheetIndex: int
- The according sheet index.row: int
- The according row index.column: int
- The according column index