ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   PivotCache.Refresh (https://www.excelbanter.com/excel-programming/395604-pivotcache-refresh.html)

Paul Dennis

PivotCache.Refresh
 
Can anyone help with this error please, when I run the following statement in
my macro

ActiveSheet.PivotTables("DataPivot").PivotCache.Re fresh


Runtime error 1004

Unable to get the PivotTable properties of the worksheet task

Debra Dalgleish

PivotCache.Refresh
 
Are you sure that's the name of the pivot table on the active sheet?


Paul Dennis wrote:
Can anyone help with this error please, when I run the following statement in
my macro

ActiveSheet.PivotTables("DataPivot").PivotCache.Re fresh


Runtime error 1004

Unable to get the PivotTable properties of the worksheet task



--
Debra Dalgleish
Contextures
http://www.contextures.com/tiptech.html


Ferris[_2_]

PivotCache.Refresh
 
On Aug 15, 2:42 pm, Paul Dennis
wrote:
Can anyone help with this error please, when I run the following statement in
my macro

ActiveSheet.PivotTables("DataPivot").PivotCache.Re fresh

Runtime error 1004

Unable to get the PivotTable properties of the worksheet task


If there's one PivotTable on the sheet you can also use:
ActiveSheet.PivotTables(1).PivotCache.Refresh

If you want to verify the name you can use:
Debug.Print ActiveSheet.PivotTables(1).Name



Kara

PivotCache.Refresh
 
I was getting the same message. I even tried recording a macro to refresh the
pivot table, but got the same code. It seemed to have worked in Excel 2003
but not in 2007.

I don't have much VBA experience, but when I changed the statement to be,
ActiveSheet.PivotTables("DataPivot").RefreshTable, the macro would continue
to run.

Hope this helps.

Kara


All times are GMT +1. The time now is 07:12 AM.

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