ActiveView Property

Microsoft Office Web Components Object Model

ActiveView Property

       

Returns a PivotView object that represents the layout of the active PivotTable list. Setting a variable to the active view of the PivotTable provides you with a convenient method to make changes to the active view. Read-only.

expression.Case

expression   Required. An expression that returns a PivotTable object.

Example

This example inserts two fieldsets in the active view of PivotTable1.

Sub Insert_Fieldsets()
    Dim vwView

    Set vwView = PivotTable1.ActiveView
 
    ' Add the Store Type field to the column axis.
    vwView.ColumnAxis.InsertFieldSet vwView.FieldSets("Store Type")
    
    ' Add the Promotions field to the row axis.
    vwView.RowAxis.InsertFieldSet vwView.FieldSets("Promotions")
End Sub