In my last post I explained how I ‘d managed to automate the refresh of a PowerPivot model from within VBA. The example workbook below contains the test code I used and a PowerPivot model based on two CSV files.
Download the example workbook from here … UPDATE: New version of code available here … (This ‘trick’ will not work in Excel 2013, that’s the bad news, the good news is it’s no longer needed as PowerPivot (in 2013 known as the Data Model) is now fully supported directly from the Excel Object Model. I’ve added some code to check if 2013+, if so, use this new functionality).
UPDATE: Mar 17th 2012
If you need to automate the refreshing of “linked” Excel tables to PowerPivot see here… UPDATE: If using Excel 2013, no need for this, as linked tables can now be refreshed using the new in-built VBA Object Model commands.Follow @gobansaor