Expand Minimize

WorksheetBase.Type Property

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

Gets the worksheet type.

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

public XlSheetType Type { get; }

Property Value

Type: Microsoft.Office.Interop.Excel.XlSheetType
One of the XlSheetType values.

The following code example uses the Type property to display whether the current worksheet is a worksheet, a dialog sheet, or a chart in a message box.

This example is for a document-level customization.

private void ShowType()
{
    switch (this.Type)
    {
        case Excel.XlSheetType.xlWorksheet:
            MessageBox.Show("This is a worksheet.");
            break;
        case Excel.XlSheetType.xlDialogSheet:
            MessageBox.Show("This is a dialogsheet.");
            break;
        case Excel.XlSheetType.xlChart:
            MessageBox.Show("This is a chart.");
            break;
    }
}

Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft