I'm trying to refresh a Power Query & then a Pivot Table (running off that data) & I can get it to work when I step through the code using F8 but it will not work when running the macro
Any ideas?
Thanks!!
Sub Test()
Dim WB As Workbook
Dim pt As PivotTable
Set WB = ThisWorkbook
Set pt = ActiveSheet.PivotTables("PivotTable1")
'Refresh Power Queries & Pivot Tables
ThisWorkbook.RefreshAll
WB.Worksheets("By Customer Pivot").Activate
pt.RefreshTable
End Sub