title: Update Pivot Table Source Data
body: <p>I'm sorry that this seems to be a duplicate question, but I've tried 2 separate methods and neither work. Here's the first:</p>
  
  <pre><code>Set wbGen = ThisWorkbook
  Set wsPivot = wbGen.Sheets("Pivot")
  Set rData = wbGen.Sheets("Fan Data").Range("A1")
  Set rData = Range(rData, rData.End(xlDown).End(xlToRight))
  NewRange = wbGen.Sheets("Fan Data").Name &amp; "!" &amp; _
      rData.Address(ReferenceStyle:=xlR1C1)
  wsPivot.PivotTables("FanPivot").ChangePivotCache _
      wsPivot.PivotCaches.Create(SourceType:=xlDatabase, SourceData:=NewRange)
  </code></pre>
  
  <p>And here's the second:</p>
  
  <pre><code>Set wbGen = ThisWorkbook
  Set wsPivot = wbGen.Sheets("Pivot")
  Set rData = wbGen.Sheets("Fan Data").Range("A1")
  Set rData = Range(rData, rData.End(xlDown).End(xlToRight))
  wsPivot.PivotTables("FanPivot").ChangePivotCache _
      wsPivot.PivotCaches.Create(SourceType:=xlDatabase, SourceData:=rData)
  </code></pre>
  
  <p>Both methods snag on the last line and return </p>
  
  <blockquote>
    <p>Run Time Error 438: Object doesn't support method or property</p>
  </blockquote>