Create Named Range in a Workbook
Contents
[
Hide
]
Possible Usage Scenarios
Aspose.Cells supports the creation of a named range. There are different ways to create a named range. One of the simplest ways is to first create Range object and then set its name using Range.SetName() method. You can see all the named ranges inside your excel file via Microsoft Excel Name Manager interface.
Create Named Range in a Workbook
The following sample code explains how to create a Named Range via Aspose.Cells. Once, the Named Range is created, it is visible inside the Workbook.GetWorksheets().GetNames() collection. Please see the output excel file generated by the code for a reference.
Sample Code
Console Output
The following console output prints the values of GetFullText and GetRefersTo methods of the created Named Range in the above code.
Full Text: MyNamedRange
Refers To: =Sheet1!$A$5:$C$10