Powerpivot COM Exception - Cannot open model - by Torben E

Status : 

 


11
0
Sign in
to vote
ID 808079 Comments
Status Active Workarounds
Type Bug Repros 5
Opened 11/8/2013 6:55:00 AM
Access Restriction Public

Description

I have an extensive data model I built in Excel 2013 64 bit. After a recent inclusion of some slicer linkages, I've not been able to access the data model or launch Powerpivot.

I'd appreciate understanding how to mitigate this error such that I don't have to rebuild the data model, and what could cause this behavior in the first place.

I suspect the first error is the root cause, which has to do with a workbook upgrade, but that doesn't make much sense since it's been developed on one machine.

The error detail is:
============================
Error Message:
============================

Object reference not set to an instance of an object.

============================
Call Stack:
============================

   at Microsoft.Office.PowerPivot.ExcelAddIn.InProcServer.CannotUpgrade(GeminiWorkbook geminiWb, WorkbookConnection wbConn, String& message)
   at Microsoft.Office.PowerPivot.ExcelAddIn.InProcServer.LoadSandboxAfterConnection(String errorCache)
   at Microsoft.Office.PowerPivot.ExcelAddIn.InProcServer.LoadSafeSandboxAfterConnection(String errorCache)
   at Microsoft.Office.PowerPivot.ExcelAddIn.InProcServer.LoadOLEDBConnection(Boolean raiseCompleteEvent, String errorCache)

============================

UPDATE:
It seems that adding workbook security is the culprit. If I add protection and specify a group of users with "Change" access, some with "Read" access and save that version, the next time it's opened it creates this error condition.
Sign in to post a comment.
Posted by cgcicca on 12/14/2015 at 4:07 AM
I've a VSTO addin doing the following and it's enought to get the error (yes just looping thought connections without doing anything). Disabling the addin or removing such a code results into powerpivot working fine.

Private Sub Application_WorkbookOpen(Wb As Microsoft.Office.Interop.Excel.Workbook) Handles Application.WorkbookOpen
        For Each lwConn As Excel.WorkbookConnection In Wb.Connections
            
        Next
End Sub

I see this opened since long time and apparently no solution or workaround available so far.
Posted by The1stMangler on 11/19/2015 at 12:04 PM
Had the same error today on my PC with PowerView and PowerPivot. I decided to reboot my machine and saw that excel was running in the background. It did not show in the application list but was in the processes list. I killed excel and re-opened my excel with the powerpivot. Works fine now.
Posted by Kasper [MSFT] on 6/13/2014 at 3:10 PM
Hello,

Thank you for filing this bug, we are working on a fix together with Excel and have filed a bug in Excels bug system. I will close this one as a duplicate of that one.

Regards,
Kasper de Jonge
Posted by jjswinNHS on 6/3/2014 at 6:35 AM
Also experiencing this problem today. Ran a report in Visual Studio 2012 Shell - SQL Data Tools - and exported it as xlsx.

opened it, added a couple more columns. Then tried to powerpivot and got this COM error. I'm not techy so haven't a clue what it means.
Posted by Shivalik Chakravarty on 4/9/2014 at 10:35 PM
Here is the full call stack: [Missed it in my previous post]

============================
Error Message:


============================

Object reference not set to an instance of an object.

============================
Call Stack:
============================

at Microsoft.AnalysisServices.BackEnd.DataModelingSandbox.IsCatalogExists()
at Microsoft.Office.PowerPivot.ExcelAddIn.InProcServer.LoadSandboxAfterConnection(String errorCache)
at Microsoft.Office.PowerPivot.ExcelAddIn.InProcServer.LoadSafeSandboxAfterConnection(String errorCache)
at Microsoft.Office.PowerPivot.ExcelAddIn.InProcServer.LoadOLEDBConnection(Boolean raiseCompleteEvent, String errorCache)

============================
Posted by Shivalik Chakravarty on 4/9/2014 at 9:41 PM
I can reproduce the error by following steps & with any one of those code blcoks. I am not using SharePoint here.

Technical Spec:
PowerPivot COM AddIn details: PowerPivotExcelClientAddIn.dll [version: 2011.110.2809.81]
Visual Studio: 2010 10.30319.1 RTMRel with .NET 4.0.30319 RTMRel
SQL Server: SSAS 2008 R2.
OS: Windows 2008 R2 [x64] [Build: 6.1.7601 Service Pack 1 Build 7601] (development machine)

1. Create a power pivot data model in Excel 2013 using PowerPivot. It works fine.
2. Create an Excel Add-In project in Visual Studio 2010 [File->New->Project->Visual C#->Office->2010->Excel 2010 Add-In. Set .NET Framework 4.0.
3. Name the entry class as ThisAddIn.cs.
4. Ensure following namespaces are present in the ribbon class & ThisAddIn.cs:
     using Excel = Microsoft.Office.Interop.Excel;
     using Office = Microsoft.Office.Core;
     using Microsoft.Office.Tools.Excel;

5. Add a ribbon button.
6. Put the following code under a ribbon button's Click event

     Excel.Application Application = ExcelAddInLab.Globals.ThisAddIn.Application;
     Excel.Workbook workbook = Application.ActiveWorkbook;
     workbook.Model.Initialize();

OR
     Excel.Application Application = ExcelAddInLab.Globals.ThisAddIn.Application;
     Excel.Workbook workbook = Application.ActiveWorkbook;
     workbook.Model.Refresh()

OR
     Excel.Application Application = ExcelAddInLab.Globals.ThisAddIn.Application;
     foreach (Excel.WorkbookConnection wbc in Application.ActiveWorkbook.Connections)
                { } //Do Nothing just loop.

7. Build and load this custom COM Add-In in Excel 2013. Ensure that in FILE->Options->Add-Ins->Manage: COM Add-ins->Go, Power View & Microsoft Office PowerPivot for Excel 2013 are checked along with this custom COM Add-In.
8. Open the workbook with the PoverPivot Data Model file.
9. Do not click on the POWERPIVOT->Manage before running the above code.
10. Click on the ribbon button which has any one of the abvoe code blocks.
11. Once executed, try to run the data model by POWERPIVOT->Manage.
12. It generates the COM error with same last three functions in the call stack.
Posted by Torben E on 1/19/2014 at 11:12 AM
Mohit, I can try to send you something to help debug. The workbook I'm referencing has confidential information in it, and as such I can't send it to you.
Posted by MarioLeung on 12/16/2013 at 1:58 AM
Hi,

Amendment on the reproduction steps:
1) open a blank workbook, create a data model by retrieving data from data service (e.g. http://services.odata.org/Northwind/Northwind.svc);
2) add a pivot table using the data model, and save;
3) add a password to protect the file, save.
4) close the excel file and then re-open.

After step (4), the data model cannot be opened.

Note that if I remove the password, save and close the file, and then reopen, the data model can be shown again.
Posted by MarioLeung on 12/15/2013 at 6:01 PM
Hi,

I encounter the same error, and I could easily reproduce by:
1) retrieve data from data service (e.g. http://services.odata.org/Northwind/Northwind.svc);
2) add a pivot table, and save;
3) add a password to protect the file, and save.

My excel 2013 version is Excel 2013 (15.0.4535.1507) MSO(15.0.4551.1007 64-bit
My OS is Windows 7 Enterprise 64-bit 6.1.7601 SP1 Build 7601
My hardware is OptiPlex 9010 with Intel(R) Core(TM) i5-3570 CPU @ 3.40GHz, 3401 Mhz, 4 Core(s), 4 Logical Processor(s) and 12.0 GB RAM

Thanks,
MarioDR
Posted by Microsoft on 11/14/2013 at 1:17 PM
Hi,
Is it possible for you to send us the workbook that reproduced this problem? We need it to be able to investigate the root cause.
Thanks
Mohit