Problem in exporting excel sheet using Office Interop

0

I have a page that exports the data to an excel workbook in 3 different worksheets (ASP.net C#) with graphs. The page is working fine on my development machine but when I am running this page on server, it is giving me 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: Error loading type library/DLL. (Exception from HRESULT: 0x80029C4A (TYPE_E_CANTLOADLIBRARY)).

I tried almost everything I found on web to fix it but no luck. I saw same problem on stackoverflow where someone suggested to delete a key from the registry editor:

Start--> Run --> regedit --> HKEY_CLASSES_ROOT-->TypeLib-->{00020813-0000-0000-C000-000000000046} --> 1.8/1.7 (Delete this)

But in my case there is only 1 key "1.8" in the registry editor. There is no other key (as shown in the screenshot below)

Screenshot

I have tried the code with my local IIS and it's working fine.

MS Office 2013 is installed on server. Earlier it was MS Office 2010 installed, but I upgraded to 2013.

Please help.

c#
asp.net
excel
office-interop
excel-2013
asked on Stack Overflow Sep 27, 2018 by DeepakVerma • edited Sep 28, 2018 by Cindy Meister

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0