Sdílet prostřednictvím


WorkbookBase.DefaultPivotTableStyle Property

Definition

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

public:
 property System::Object ^ DefaultPivotTableStyle { System::Object ^ get(); void set(System::Object ^ value); };
public object DefaultPivotTableStyle { get; set; }
member this.DefaultPivotTableStyle : obj with get, set
Public Property DefaultPivotTableStyle As Object

Property Value

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 void SetPivotTableStyle()
{
    this.DefaultPivotTableStyle = this.TableStyles["PivotStyleMedium3"];
}
Private Sub SetPivotTableStyle()
    Me.DefaultPivotTableStyle = Me.TableStyles("PivotStyleMedium3")
End Sub

Applies to