NativeExcel2 for .Net Developer's Reference

INames.AddMethod

Defines a new name. Returns an IName interface.

Overload List

Defines a new name. Returns an IName interface.

[Visual Basic] FunctionAdd(ByValString,ByValIRange)AsIName
[C#] INameAdd(string,IRange);
[C++] IName*Add(String*,IRange*);
[JScript] functionAdd(String,IRange):IName;

Defines a new name. Returns an IName interface.

[Visual Basic] FunctionAdd(ByValString,ByValIRange,ByValBoolean)AsIName
[C#] INameAdd(string,IRange,bool);
[C++] IName*Add(String*,IRange*,bool);
[JScript] functionAdd(String,IRange,bool):IName;

Defines a new name. Returns an IName interface.

[Visual Basic] FunctionAdd(ByValString,ByValString)AsIName
[C#] INameAdd(string,string);
[C++] IName*Add(String*,String*);
[JScript] functionAdd(String,String):IName;

Defines a new name. Returns an IName interface.

[Visual Basic] FunctionAdd(ByValString,ByValString,ByValBoolean)AsIName
[C#] INameAdd(string,string,bool);
[C++] IName*Add(String*,String*,bool);
[JScript] functionAdd(String,String,bool):IName;

Example

This example adds new defined name for the workbook and use this name in the cell formula.

[C#]
Workbook.Names.Add("MyName","=Sheet1!$F$10:$H$20");
Workbook.Worksheets[1].Cells[3,4].Formula = "=SUM(MyName)";
[VisualBasic]
Workbook.Names.Add("MyName","=Sheet1!$F$10:$H$20")
Workbook.Worksheets(1).Cells(3,4).Formula = "=SUM(MyName)"
[C++]
Workbook->Names->Add(S"MyName", S"=Sheet1!$F$10:$H$20");
Workbook->Worksheets->Item[1]->Cells->Item[3,4]->Formula = S"=SUM(MyName)";

See Also

INames Interface | NativeExcel Namespace