ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Changing pivot table ADO recordset (https://www.excelbanter.com/excel-programming/445741-changing-pivot-table-ado-recordset.html)

[email protected]

Changing pivot table ADO recordset
 
Hi fellows,
I've created a pivot table from an ADO recordset. (No problem in that)
like in this code:

Dim rs As New ADODB.Recordset
rs.open ........
Dim pc As PivotCache
Set PC=ThisWorkbook.PivotCaches.Create(....)
Set pc.Recordset = rs
pc.CreatePivotTable(...)


The problem is:
If the source data has changed and I want to transfer these updates to the pivot table (and its pivot cache).
How can I tell the pivot table (or its pivot cache) to use another updated ADO recordset?

I do not want to re-construct a new pivot table each time there are changes in the source data, Just updating the data (or the recordset) in the first pivot table.

Also I do not want the trivial solution that is pasting the recordset contents into a worksheet using rs.CopyFromRecordset and then use the pasted range as a source for a permanent pivottable.
I just want to throw a new recordset into the pivot table (or its pivot cache) directly.

Thanks in advance


All times are GMT +1. The time now is 08:09 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com