I have a template workbook, which has several data tables connected to sql connections, as well as some pivot tables who's sources are the data brought through.
I was under the impression that ActiveWorkbook.RefreshAll
would update all connections, then update the pivots. That in fact is what happens when I run the refresh all manually. However, when I run the VBA (which is actually in Access, but is correctly referenced etc) it updates the connections but NOT the pivot tables?
I've tried DoEvents
after the RefreshAll
which had no effect.
Is my only option now to run a For each
through all the worksheets, data sources, pivot caches and refresh them that way?
I have solved the issue by adding a simple 'Calculate' to the code.
Calculate
ActiveWorkbook.RefreshAll
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With