0
votes

In my WPF application I am using Microsoft.Office.Interop.Excel to import data from excel file. I have been using this code for last couple of months and it has been working just fine for me. Today all of a sudden when I ran the utility I got the following error.

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: Library not registered. (Exception from HRESULT: 0x8002801D (TYPE_E_LIBNOTREGISTERED)).

I had originally Office 2013 installed but 2 months ago I uninstalled and installed the 2007 version. Everything was working fine until now.

I have read on different posts to delete the registry entry corresponding to the above IID. I have tried doing that but no help. I uninstalled/repaired Office as well but no help.

I have tried to register the Microsoft.Office.interop.excel.dll using regasm.exe as well but again no luck. Whats the issue here?

1
Have you tried to search Microsoft.Office.Interop.Excel under HKRT\TypeLib and delete the 2013 version - Clive DM
it worked. Thanks :) - WAQ
What is full path of HKRT\typeLib i cant find it!!! is it under HKEY_CLASSES_ROOT? - R01

1 Answers

-2
votes

I had a some problems with Interop. then I switched to Microsoft.Jet.OLEDB.4.0 don't know if it helps, but I found it to be much more stable.