NativeExcel2 for .Net Developer's Reference

IName.Name Property

Gets or sets the name of the defined name.

[Visual Basic]
PropertyNameAsString
[C#]
stringName{get;set;}
[C++]
__propertyString*get_Name();
__propertyvoidset_Name(String*);
[JScript]
functiongetName():String
functionsetName(String);

Property Value

A string containing the name of the defined name.

Example

This example renames first defined name in worksheet one.

[C#]
INames names = Workbook.Worksheets[1].Names;
if (names.Count > 0) names[1].Name = "MyNewName";
[VisualBasic]
Dim names As INames = Workbook.Worksheets(1).Names
If names.Count > 0 Then
   names(1).Name = "MyNewName"
End If 
[C++]
INames* names = Workbook->Worksheets->Item[1]->Names;
if (names->Count > 0) names->Item[1]->Name = S"MyNewName";

See Also

IName Interface | NativeExcel Namespace