title: Runtime Error 1004: Unable to get the PivotTables property of the Worksheet class
body: <p>I recorded this macro to update the date range of 16 charts. But, as you can see I am getting a Run-time error. </p>
  
  <p>I have looked at other threads on stackoverflow that relate to this but none come close. The darn help button on excel doesn't help either.  Can you please advise? Here is the code:</p>
  
  <pre><code>ActiveSheet.ChartObjects("Chart 18").Activate
  ActiveChart.Axes(xlCategory).Select
  ActiveSheet.ChartObjects("Chart 18").Activate
  With ActiveSheet.PivotTables("PivotTable2").PivotFields("Date")
      .PivotItems("Sep-15").Visible = False
      .PivotItems("Aug-14").Visible = True
  End With
  </code></pre>