title: Run Time Error 1004 'Unable to get the PivotFields property of the PivotTable class'
body: <p>I am trying to use the code to select all the rows under one of the subheaders in a pivot table.  I am getting a run time error 1004:</p>
  <blockquote>
  <p>Unable to get the PivotFields property of the Pivot Table class</p>
  </blockquote>
  <p>From this code:</p>
  <pre><code> Sub ttest()
   Dim pt As PivotTable
   Set pt = Sheets(&quot;Report&quot;).PivotTables(&quot;PivotTable1&quot;)
  
   pt.PivotFields(&quot;Row Labels&quot;).PivotItems(&quot;CL&quot;).DataRange.Select
  
   End Sub
  </code></pre>
  <p>Why?</p>