Reading PivotCache for Pivot Table

A

Adam

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?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top