title: Unable to get Pivot Fields Property of the Pivot Table Class
body: <p>Trying to change Root Account and Year in multiple pivot tables (created from Power Pivot) but getting below error.  Please help</p>
  <pre><code>Sub RootAccountAndYear()
  
  Dim ws As Worksheet
  Set ws = ThisWorkbook.Sheets(&quot;Analysis&quot;)
  
  Dim rootAccount As String
  rootAccount = ws.Cells(1, 10).Value
          
  Dim year As String
  year = ws.Cells(2, 10).Value
  
  Dim pt As PivotTable
  
  For Each pt In ws.PivotTables
  
      With pt
          With .PivotFields(&quot;Root Account&quot;)    '**unable to get Pivot Fields Property of the Pivot Table Class**
               .CurrentPage = rootAccount
          End With
          With .PivotFields(&quot;Year&quot;)
               .CurrentPage = year
          End With
      End With
      
  Next
  
  End Sub
  </code></pre>