DataModel tables do not refresh with VBA Thisworkbook.Model.Refresh

OrbitBank

New Member
Joined
May 6, 2019
Messages
1
Excel 2016


I have a DataModel that is fed from 9 Excel tables (notPowerQuery). I use VBA to run SQLqueries and dump the results into these 9 tables and then refresh the DataModelwith Thisworkbook.Model.Refresh.


However, not all the tables refresh their data and am at a lossas to how to correct. I’ve verified thatthe raw Excel tables are updating, and even put in calculated columns to theDataModel tables with a simple Now() calculation to check when the DataModel tablesrefresh. The Now timestamp updates onthe DataModel tables but the data from the Excel tables does not get passed/pushedinto the DataModel.



Events, calculations, and screenupdating are turned off atthe start of the macro, but events and calculations are turned back on prior tothe refresh. I’ve tried wrapping therefresh in DoEvents as well.


The only thing that works is to run Thisworkbook.Model.Refreshback to back.




 

Excel Facts

Square and cube roots
The =SQRT(25) is a square root. For a cube root, use =125^(1/3). For a fourth root, use =625^(1/4).

Forum statistics

Threads
1,214,978
Messages
6,122,549
Members
449,089
Latest member
davidcom

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top