Is it possible to connect to a PowerPivot model in an Excel .xlsx file? (Not hosted on a SharePoint site… just the local file).
It must be, since Tableau can do it.
Anyone have any clues?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Short answer:
Long answer:
References/Credits:
Details:
Like @gobansaor, we found that starting with a workbook which already had a connection to the PP cache was helpful (necessary?). Before connecting to the PP cache via AMO for instance, we make sure the connection is alive:
ThisWorkbook.Connections["PowerPivot Data"].Reconnect()or
ThisWorkbook.Connections["PowerPivot Data"].Refresh()The connection string template we used for AMO was:
Provider=MSOLAP;Data Source=$Embedded$;Locale Identifier=1033;Location={0};SQLQueryMode=DataKeysand we filled that in withThisWorkbook.FullNameFollowing @gobansaor, we connected to the cube via ADO using:
ADODB.Recordset recordSet = new ADODB.Recordset();recordSet.Open("SELECT [Measures].[Min of Field1] ON COLUMNS FROM [Model]",ThisWorkbook.Connections["PowerPivot Data"].OLEDBConnection.ADOConnection);