WorksheetBase.Type Property


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.");
        case Excel.XlSheetType.xlDialogSheet:
            MessageBox.Show("This is a dialogsheet.");
        case Excel.XlSheetType.xlChart:
            MessageBox.Show("This is a chart.");
Return to top