Runtime Error 1004: Unable to get the PivotTables property of the worksheet class. My recorded macro doesnt run?

233 Views Asked by At

This is driving my nut, i spent the last hour trying to find a fix to these with no success. I have a few PivotCharts in a worksheet and i need to refresh them manually. So i tried to record a macro doing a left click and a refresh, here is the result of the macro :

ActiveChart.PlotArea.Select
ActiveChart.ChartArea.Select
ActiveSheet.PivotTables("PivotChartTable5").PivotCache.refresh

ok, when i tried to run the the macro, i have the following error :

enter image description here

And if i get rid of the first 2 lines of the macro, select one chart and run the macro (the last line only) i have the following error :

enter image description here

I need help. I tried to replace the activeSheet with the current sheet (Sheets.("mysheet")), doesnt help :( One thing, if i click on the chart, i dont find the PivotChartTable5 name anywhere, my charts are called something like Chart 12 or whatever the number.

Thanks

0

There are 0 best solutions below