NamedRange.Application Property

 

Gets a Microsoft.Office.Interop.Excel.Application that represents the creator of the NamedRange control.

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

Application Application { get; }

Property Value

Type: Microsoft.Office.Interop.Excel.Application

A Microsoft.Office.Interop.Excel.Application that represents the creator of the NamedRange control.

The following code example gets the name and version of the application that contains the NamedRange and displays the information in a message box.

This example is for a document-level customization.

private void DisplayApplicationVersion()
{
    Microsoft.Office.Tools.Excel.NamedRange namedRange1 =
        this.Controls.AddNamedRange(this.Range["A2", "C4"],
        "namedRange1");
    string applicationVersion = namedRange1.Application.Name +
        " " + namedRange1.Application.Version;
    MessageBox.Show(applicationVersion);
}
Return to top
Show: