psulions83
Board Regular
- Joined
- Nov 16, 2015
- Messages
- 127
I have the below code to update pivots tables. It runs properly by itself. The problem I am having is that it does not update when i attach it to a button with another macro. The button calls on the pivot table refresh macro and a macro that pulls in data. It properly pulls in data but does not do the refresh. When I run the refresh code by itself after hitting the button it works properly.
Sub AllWorksheetPivots()
Dim xTable As PivotTable
For Each xTable In Application.ActiveSheet.PivotTables
xTable.RefreshTable
Next
End Sub
Is there a way to incorporate the refresh pivot tables into the below vba?
appAccess.DoCmd.RunMacro "Macro_Del"
appAccess.DoCmd.RunMacro "Macro_1"
ActiveWorkbook.RefreshAll
Sub AllWorksheetPivots()
Dim xTable As PivotTable
For Each xTable In Application.ActiveSheet.PivotTables
xTable.RefreshTable
Next
End Sub
Is there a way to incorporate the refresh pivot tables into the below vba?
appAccess.DoCmd.RunMacro "Macro_Del"
appAccess.DoCmd.RunMacro "Macro_1"
ActiveWorkbook.RefreshAll
Last edited: