none
Problem with Office Interop DLL's RRS feed

  • Question

  • Our application is using Microsoft.Office.Interop.Excel for importing data from Excel on one of our clients computer we have noticed issue as below: 

    Unable to cast COM object of type 'Microsoft.Office.Interop.Excel.ApplicationClass' to interface type 'Microsoft.Office.Interop.Excel._Application'. This operation failed because the QueryInterface call on the COM component for the interface with IID '{000208D5-0000-0000-C000-000000000046}' failed due to the following error: Interface not registered (Exception from HRESULT: 0x80040155).

    On computer there is Office 365 which install Excel 2016 - after review on the internet I have checked registry keys and what strange I have noticed that office 16 has install relation to DLL from version 15(!) not 16 as on other machines I have checked. 

    In GAC installation has also installed DLLs for office 2013 (version 15 of DLL). The strangest thing I have noticed was that in Program Files folder of office 2016  there was a dll for... office 2010 (version 14 of dll), I have made full repair for office which has delete old files and again install this from description. 

    Have anyone the same situation ? 

    Tuesday, August 2, 2016 6:48 AM

All replies

  • Hi,

    I notice that you are using Microsoft.Office.Interop.Excel for importing data from Excel. For the error description, I suggest we can ask a question in Excel for Developers forum for better troubleshooting.

    I have moved your thread to Excel for Developers forum. Hope your can find the solution here :)


    Regards,

    Winnie Liang
    TechNet Community Support


    Please mark the reply as an answer if they help and unmark them if they provide no help.

    If you have feedback for TechNet Support, contact tnmff@microsoft.com.

    Thursday, August 4, 2016 2:20 AM
  • Does this client computer differ from the working ones in any aspect? (32/64 bit, version of Windows, processor type etc).

    Best regards, George

    Thursday, August 4, 2016 1:02 PM
  • >>>Our application is using Microsoft.Office.Interop.Excel for importing data from Excel on one of our clients computer we have noticed issue as below

    Do you developing server-side automation of Office Application? If so, a number of complications can occur if Automation takes place from server-side code such as Microsoft Active Server Pages (ASP), ASP.NET, DCOM, or a Windows NT service.

    For more information, click here to refer about Considerations for server-side Automation of Office

    If not, could you provide your sample code, that will help us reproduce and resolve it.

    >>>what strange I have noticed that office 16 has install relation to DLL from version 15(!) not 16 as on other machines I have checked. 

    According to your description, at the Moment there's no Office 2016 PIA, we still use that Office 15 PIA.

    Thanks for your understanding.
    Friday, August 5, 2016 2:25 AM
  • No, computer is typicall machine on our software work - the only diffirence is that customer update hist Office 365 and get Excel 2016
    Friday, August 5, 2016 2:15 PM
  • Please also reply to David's post

    Best regards, George

    Friday, August 5, 2016 3:36 PM
  • We don't develop any server side automation of office application. 

    Code is not influencing on problem because exception occurs when dll has to been loaded. 

    What I have noticed customer updating history was 

    Office 365 Business

    then 

    Office 365 Small Business Premium 

    and now 

    Office 365 Business Premium

    My confusion about office interop dll was caused because on my computer i found Microsoft.office.interop.excel in version 16.0.7070.5029. It is on the same place where i found 14.0.7070 on clients machine. 

    Thank for any replies

    Sunday, August 7, 2016 12:16 PM
  • I have replied - as I wrote on my computer I found office 16 dll on clients machine not. I have also included how license was evoluting on clients machine. 

    Regards

    Sunday, August 7, 2016 12:18 PM
  • I can speculate a bit.

    It sounds as if your registry keys are pointing to the wrong libraries.

    Perhaps some software (might not be yours) installed and registered the Office 2013 PIA package after Office 2016 was installed. If might even be that Office 2013 was installed and then removed (after Office 2016 was installed).

    For the COM interfaces to work right, multiple versions of Office can only be installed in the correct sequence - First install Office 2013 then Office 2016, for example.

    I suggest you repair or reinstall Office 2016 on that machine.

    -Govert

    Excel-DNA - Free and easy .NET for Excel

    Sunday, August 7, 2016 12:49 PM
  • I have tried to repair office but with any results - I have noticed that in Add/Delete Programs there were 2 names "Office 365 Business" and "Office 365 Small Premium Business" both of them on repair install the same version of Excel
    Monday, August 8, 2016 9:03 AM
  • Hi prze_cinek,

    According to your description, please your Microsoft.Office.Interop.Excel.dll's location like below:

    For more information, click here to refer about Office Primary Interop Assemblies


    Tuesday, August 9, 2016 9:50 AM