Name Class
Represents a defined name for a range of cells.
Inheritance Hierarchy
SystemObject
  Aspose.CellsName

Namespace: Aspose.Cells
Assembly: Aspose.Cells (in Aspose.Cells.dll) Version: 19.11.0.0 (19.11)
Syntax
public class Name

The Name type exposes the following members.

Properties
  NameDescription
Public propertyComment
Gets and sets the commont of the name. Only applies for Excel 2007.
Public propertyFullText
Gets the name full text of the object with the scope setting.
Public propertyIsReferred
Indicates whether this name is referred by other formulas.
Public propertyIsVisible
Indicates whether the name is visible.
Public propertyR1C1RefersTo
Gets or sets a R1C1 reference of the Name.
Public propertyRefersTo
Returns or sets the formula that the name is defined to refer to, beginning with an equal sign.
Public propertySheetIndex
Indicates this name belongs to Workbook or Worksheet. 0 = Global name, otherwise index to sheet (one-based)
Public propertyText
Gets the name text of the object.
Methods
  NameDescription
Public methodEquals
Determines whether the specified Object is equal to the current Object.
(Inherited from Object.)
Protected methodFinalize
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object.)
Public methodGetHashCode
Serves as a hash function for a particular type.
(Inherited from Object.)
Public methodGetRange
Gets the range if this name refers to a range.
Public methodGetRange(Boolean)
Gets the range if this name refers to a range
Public methodGetRange(Int32, Int32, Int32)
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.
Public methodGetRanges
Gets all ranges referred by this name.
Public methodGetRanges(Boolean)
Gets all ranges referred by this name.
Public methodGetReferredAreas
Gets all references referred by this name.
Public methodGetRefersTo
Get the reference of this Name.
Public methodGetType
Gets the type of the current instance.
(Inherited from Object.)
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Public methodSetRefersTo
Set the reference of this Name.
Public methodToString
Returns a string represents the current Range object.
(Overrides ObjectToString.)
Examples
[C#]

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

[Visual Basic]

'Instantiating a Workbook object
Dim workbook As Workbook = New Workbook()
'Accessing the first worksheet in the Excel file
Dim worksheet As Worksheet = workbook.Worksheets(0)
'Creating a named range
Dim range As Range = worksheet.Cells.CreateRange("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("C:\\output.xls")
See Also