I have an Office Data Connection (ODC) pointed at an OLAP cube stored on our company's server. The connection string is fairly straightforward:
Provider=MSOLAP.6;Integrated Security=SSPI;Persist Security Info=True;Initial Catalog=Reporting Model;Data Source=SQL03;MDX Compatibility=1;Safety Options=2;MDX Missing Member Mode=Error
Using this cube, I have created an Excel file with multiple PivotTables, one per worksheet. Everything works fine, but when I refresh the PivotTables to get the latest data, each PivotTable refreshes separately i.e., the following appears for each PivotTable using the connection to the cube:
- Refreshing the OLAP cube
- Running OLAP query
Is there a solution that only requires a single refresh, with all pivottables sharing it? I've tried making all the PivotTables use the same cache, but attempting to set the pivot cache using:
Sheets("Pivot").PivotTables(1).CacheIndex = 1
ends in Run-time error '1004': Application-defined or object-defined error
Is there a way to get all the PivotTables to share the data source somehow?
Perhaps by created a local copy of the OLAP cube upon file open or by caching the PivotTable in a different way?
I've been playing with the VBA found at http://www.contextures.com/xlPivot11.html but it all seems to assume your data is coming from a local source.