We recommend using Visual Studio 2017
This documentation is archived and is not being maintained.

NamedRange.Name Property

Gets or sets a Name object for the NamedRange control.

Namespace:  Microsoft.Office.Tools.Excel
Assembly:  Microsoft.Office.Tools.Excel (in Microsoft.Office.Tools.Excel.dll)

Object Name { get; set; }

Property Value

Type: System.Object
A Name object for the NamedRange control.

The following code example creates a NamedRange and then displays the name in a message.

This example is for a document-level customization.

private void DisplayName()
    Microsoft.Office.Tools.Excel.NamedRange namedRange1 =
        this.Range["B2"], "Sales");

    Excel.Name name1 = ((Excel.Name)namedRange1.Name);