View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Adam[_9_] Adam[_9_] is offline
external usenet poster
 
Posts: 15
Default Reading PivotCache for Pivot Table

A colleague has deleted the underlying data for a Pivot
Table. I was hoping to retrieve the original data from the
PivotCache using code like this:

Dim MyPC As PivotCache

Set MyPC = ActiveWorkbook.PivotCaches(1)

'Write the recordset
Range("A10").Offset(1, 0).CopyFromRecordset
MyPC.Recordset

When run, this code generates an "Application-defined or
Object-defined error". Is it possible to read the
PivotCache underlying a Pivot Table?