ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Pivot Table refresh in VBA code not working (https://www.excelbanter.com/excel-programming/422183-pivot-table-refresh-vba-code-not-working.html)

Carlos

Pivot Table refresh in VBA code not working
 
Hi,
I'm getting an error when I try to refresh a pivot table that was created
using VBA code in Excel 2000. This the error: "Refresh method of pivot table
class failed".

Here is the piece of code:
Set ptCache.Recordset = rst
With wsSheet
Set ptTable = .PivotTables("Test")
End With
'Refresh Data.
ptTable.RefreshTable

Initially when I get the recordset and create the pivot table, every is
populated correctly. But when I need to run the refreshing code to get new
data into the pivot table, the refreshtable fail.

Any suggestion?
I will appreciate that.

Thanks,
Carlos.


All times are GMT +1. The time now is 01:45 PM.

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