I need someone who can explain this:
I have a PivotTable in excel and I have recorded a macro that refreshes the PivotTable. Looks like this:
ActiveSheet.PivotTables("PivotTable1").PivotSelect "Data[All]", xlLabelOnly
This macro only works if I execute it from the tools menu/macro/play mecro, if a execute it from a CommandButton I only receive Runtime error ?1004?.
Can someone please help me with this? Maybe there are different ways of refreshing pivottables that I don?t know.