View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Bryan S[_2_] Bryan S[_2_] is offline
external usenet poster
 
Posts: 2
Default Need code assistance to update pivot table from an ADO records

I'm not looking to recreate the pivot table each and everytime, but merely
take the recordset "objRS" and update the pivotcache on
ActiveSheet.PivotTables("Test PT").

If I got to the exisitng pivottable and do a right click, the Refresh Data!
option is grayed out. I assume that this is because the orginal pivot table
was created from ADO recordset, i.e., now disconnected.

"TomPl" wrote:

Maybe I misunderstood the question, but it looks to me like you are trying to
recreate the pivot cache each time you want to refresh the data. If I
understand this correctly, you should not do that, you should simply refresh
the pivot table with code similar to:

ActiveSheet.PivotTables("PivotTable1").PivotCache. Refresh

Of course you would need to identify your specific pivot table. Remember
that if more than one pivot table is attached to a pivot cache, then all
tables will be refreshed when you refresh one.

It is a crazy world we live in.