Name class
Name class
Represents a defined name for a range of cells.
The Name type exposes the following members:
Properties
Property | Description |
---|---|
comment | Gets and sets the comment of the name. Only applies for Excel 2007 or higher versions. |
text | Gets the name text of the object. |
full_text | Gets the name full text of the object with the scope setting. |
refers_to | Returns or sets the formula that the name is defined to refer to, beginning with an equal sign. |
r1c1_refers_to | Gets or sets a R1C1 reference of the Name . |
is_referred | Indicates whether this name is referred by other formulas. |
is_visible | Indicates whether the name is visible. |
sheet_index | Indicates this name belongs to Workbook or Worksheet. 0 = Global name, otherwise index to sheet (one-based) |
Methods
Method | Description |
---|---|
get_refers_to | Get the reference of this Name. |
get_refers_to | Get the reference of this Name based on specified cell. |
get_ranges | Gets all ranges referred by this name. |
get_ranges | Gets all ranges referred by this name. |
get_range | Gets the range if this name refers to a range. |
get_range | Gets the range if this name refers to a range |
get_range | 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. |
set_refers_to | Set the reference of this Name. |
get_referred_areas | Gets all references referred by this name. |
Example
from aspose.cells import Workbook
# Instantiating a Workbook object
workbook = Workbook()
# Accessing the first worksheet in the Excel file
worksheet = workbook.worksheets[0]
# Creating a named range
range = worksheet.cells.create_range("B4", "G14")
# Setting the name of the named range
range.name = "TestRange"
# Saving the modified Excel file in default (that is Excel 2000) format
workbook.save("output.xls")
See Also
- module
aspose.cells
- class
Name