[]
        
(Showing Draft Content)

GrapeCity.Documents.Excel.INames.Add

Add Method

Add(string, string)

Defines a new name. Returns the IName object.

Uses A1-style notation in refersTo to define what the name refers to, such as a cell, range, formula, or constant.

Declaration
IName Add(string name, string refersTo)
Function Add(name As String, refersTo As String) As IName
Parameters
Type Name Description
string name

The text to use as the name. Names cannot include spaces and cannot look like cell references.

string refersTo

The A1-style reference string that describes what the name refers to.

Returns
Type Description
IName

Returns a new IName object.

Examples
INames names = worksheet.Names;
worksheet.Range["A1:B3"].Value = new object[,] {
    { "Name", "Value" },
    { "Test", 100 },
    { "Total", 200 }
};
IName salesData = names.Add("SalesData", "=A1:B3");