Expand Minimize
This topic has not yet been rated - Rate this topic

NamedRange.Worksheet Property

[This documentation is for preview only, and is subject to change in later releases. Blank topics are included as placeholders.]

Gets a Microsoft.Office.Interop.Excel.Worksheet that represents the worksheet that contains the NamedRange control.

Namespace:  Microsoft.Office.Tools.Excel
Assembly:  Microsoft.Office.Tools.Excel (in Microsoft.Office.Tools.Excel.dll)
Worksheet Worksheet { get; }

Property Value

Type: Microsoft.Office.Interop.Excel.Worksheet
A Microsoft.Office.Interop.Excel.Worksheet that represents the worksheet that contains the NamedRange control.

The following code example displays the name of the worksheet that contains a NamedRange.

This example is for a document-level customization.

private void DisplayWorksheetName()
{
    Microsoft.Office.Tools.Excel.NamedRange namedRange1 =
        this.Controls.AddNamedRange(this.Range["A1"],
        "namedRange1");
    namedRange1.Worksheet.Name = "Sales";
    MessageBox.Show("The NamedRange is on worksheet " +
        namedRange1.Worksheet.Name);
}
Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft. All rights reserved.