Good afternoon,
I run a userform that submits data to a database and then comes back to the current workbook and should update the 2 pivot tables I have in my workbook.
The code below refreshes the 1st table but doesn't refresh the 2nd one. I have tried this with and without the second "ActiveWorkbook.Connections("ReportsTabPivot").Refresh" and it doesn't refresh. I have to right click and refresh for this table to update.
Any ideas how I can rectify this to auto refresh like the 1st table?
thanks
Gavin
I run a userform that submits data to a database and then comes back to the current workbook and should update the 2 pivot tables I have in my workbook.
The code below refreshes the 1st table but doesn't refresh the 2nd one. I have tried this with and without the second "ActiveWorkbook.Connections("ReportsTabPivot").Refresh" and it doesn't refresh. I have to right click and refresh for this table to update.
Any ideas how I can rectify this to auto refresh like the 1st table?
Code:
'Refreshes data links so pivot tables can update 1st Table
ActiveWorkbook.Connections("ReportsTabPivot").Refresh
'refreshes Pivot Table
Worksheets("Reports").Select
ThisWorkbook.RefreshAll
'Refreshes data links so pivot tables can update 2nd Table
Worksheets("Raise").Select
ActiveWorkbook.Connections("ReportsTabPivot").Refresh
Range("E24").Select
ActiveWorkbook.RefreshAll
thanks
Gavin