WorkbookBase.DefaultPivotTableStyle Property

Gets or sets the table style from the TableStyles property that is used as the default style for PivotTable reports in the workbook.

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

Syntax

'Declaration
Public Property DefaultPivotTableStyle As Object
public Object DefaultPivotTableStyle { get; set; }

Property Value

Type: System.Object
The table style from the TableStyles property that is used as the default style for PivotTable reports in the workbook.

Examples

The following code example sets the default style of pivot tables to Pivot Style Medium 3, which is a style that is available in Excel on the Design tab in the PivotTable Styles group when a pivot table is selected.

This example is for a document-level customization.

Private Sub SetPivotTableStyle()
    Me.DefaultPivotTableStyle = Me.TableStyles("PivotStyleMedium3")
End Sub
private void SetPivotTableStyle()
{
    this.DefaultPivotTableStyle = this.TableStyles["PivotStyleMedium3"];
}

.NET Framework Security

See Also

Reference

WorkbookBase Class

Microsoft.Office.Tools.Excel Namespace