NativeExcel for .Net Developer's Reference

IWorksheet.Names Property

Returns an INames collection that represents all the defined names in the specified worksheet.

[Visual Basic]
PropertyReadOnlyNamesAsINames
[C#]
INamesNames{get;}
[C++]
__propertyINames*get_Names();
[JScript]
functiongetNames():INames

Property Value

INames collection.

Example

This example creates a new defined name for the worksheet one.

[C#]
Workbook.Worksheets[1].Names.Add("MyName","=Sheet1!$A$2");
[VisualBasic]
Workbook.Worksheets(1).Names.Add("MyName","=Sheet1!$A$2")
[C++]
Workbook->Worksheets->Item[1]->Names->Add(S"MyName",S"=Sheet1!$A$2");

See Also

IWorksheet Interface | NativeExcel Namespace | INames Interface | IWorkbook.Names