[]
Represents a defined name for a range of cells.
A defined name lets you assign a meaningful identifier to a cell range, formula, or constant so that it can be reused more clearly in workbook or worksheet formulas. An IName object stores the name itself together with the formula it refers to.
public interface IName
Public Interface IName
IName definedName = workbook.Names.Add("SalesData", "=Sheet1!$A$1:$C$5");
string name = definedName.Name;
string refersTo = definedName.RefersTo;
| Name | Description |
|---|---|
| Comment | Gets or sets the comment associated with the name. Use this property to retrieve or set the descriptive text assigned to a defined name. |
| Name | Gets or sets the name of the object. For a defined name, this property returns the name text used to identify the referenced range, formula, or constant. |
| RefersTo | Gets or sets the formula that the name is defined to refer to, in the language of the macro and in A1-style notation, beginning with an equal sign. Use this property to retrieve or set the current A1-style formula, cell reference, range reference, or constant assigned to the defined name. |
| RefersToR1C1 | Gets or sets the formula that the name is defined to refer to, in the language of the macro and in R1C1-style notation, beginning with an equal sign. Use this property to read or set the defined name formula in R1C1-style notation. To work with the A1-style equivalent, use RefersTo. |
| Visible | Gets or sets whether the name is visible. |
| Name | Description |
|---|---|
| Delete() | Deletes the object. Use this method to remove a workbook-level or worksheet-level name that is represented by this IName object. |
| FromJson(string) | Loads a defined name definition from the JSON string into this object. Use this method to apply a defined name definition from a JSON string, such as one generated by ToJson(). |
| ToJson() | Generates the JSON string from the defined name. |