I have a macro to refresh a pivot table on sheet "dashboard"
I get a run time error reference is'nt valid
the following code is highlighted
It would be appreciated if someone could advise on how to resolve this
I get a run time error reference is'nt valid
the following code is highlighted
Code:
ActiveSheet.PivotTables("PivotTable1").PivotCache.Refresh
I then recorded a macro and manually refreshed the data and had no error
However when running the recorded macro , I got the same error
See my full code
[code] Sub Refresh_Pivot_Sales()
Sheets("Dashboard").Select
ActiveSheet.PivotTables("PivotTable1").PivotCache.Refresh
End Sub
It would be appreciated if someone could advise on how to resolve this