Stretchwickster
Programmer
I've added a command button directly to my excel sheet. Then I recorded what happens when I refresh my table and it generated the following VBA code:
I pasted this code into my command button click event but when I click it at run-time, it gives the following error: "RefreshTable method of PivotTable class failed". Anyone know what the problem is or how to get it to work properly.
Any help would be much appreciated!
Clive![[infinity] [infinity] [infinity]](/data/assets/smilies/infinity.gif)
Code:
ActiveSheet.PivotTables("PivotTable3").PivotSelect "'4'", xlDataAndLabel
ActiveSheet.PivotTables("PivotTable3").RefreshTable
ActiveSheet.PivotTables("PivotTable4").PivotSelect "'5'", xlDataAndLabel
ActiveSheet.PivotTables("PivotTable4").RefreshTable
I pasted this code into my command button click event but when I click it at run-time, it gives the following error: "RefreshTable method of PivotTable class failed". Anyone know what the problem is or how to get it to work properly.
Any help would be much appreciated!
Clive
![[infinity] [infinity] [infinity]](/data/assets/smilies/infinity.gif)