Microsoft.Office.Interop.Excel Fails

Posted on 2012-08-20
Medium Priority
Last Modified: 2012-08-20
I installed the Office 2013 RC and then uninstalled. Now when I run a Windows Application developed in C# using visual studio 2008 I get 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

I know the code is correct because I have been using it for a long time and I know the problem is with the Interop.Excel that it is messed up but I don't know how to fix it. I have upgraded excel on my machine from 2003 to 2010 I still have Access 2003 installed and Publisher 2007 along with the Office 2010.
I tried to repair the office installations (2003,2007,2010) and reinstall the PIA for 2003 and 2010 but no luck.
Any help on how to clean the references and make it work will be appreciated.
Question by:ocortesmx
  • 3
  • 2
LVL 45

Accepted Solution

AndyAinscow earned 2000 total points
ID: 38312970
I'd suggest de-installing office, running a registry cleaner (there are numbers available on the internet) then reinstalling office.

Author Comment

ID: 38312983
I was checking the GAC and I see the following entries:

Microsoft.Office.Interop.Excel v.15
Microsoft.Office.Interop.Excel v.14

Policy.11.0.Microsoft.Office.Interop.Excel v. 15
Policy.11.0.Microsoft.Office.Interop.Excel v. 14
Policy.12.0.Microsoft.Office.Interop.Excel v. 15
Policy.12.0.Microsoft.Office.Interop.Excel v. 14
Policy.14.0.Microsoft.Office.Interop.Excel v. 15
Policy.14.0.Microsoft.Office.Interop.Excel v. 14

Should I uninstall some of them? I need the application to export to Excel 2003 and above like it was doing before. Actually it still works on the machines that I deploy the application, it is just on my development machine that it stopped working but I am affraid that if I create a new version of the program now that it is not working on my machine the other machines will be confused too.
Thanks for any help.

Author Comment

ID: 38313003
"I'd suggest de-installing office, running a registry cleaner (there are numbers available on the internet) then reinstalling office."

Thanks for the suggestion but I will need to uninstall office 2003, 2007, and 2010 and then reinstall them and I am not sure that I want to do that. I am hopping that there is another way to fix the problem.
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

LVL 45

Expert Comment

ID: 38313045
I would still recommend doing what I suggested.  You could try deleting things but it might not work or even makes things worse.

(I know it is a bit late - but trying beta software on your development machine without a complete backup <I'd even say clone the hard disc> is not a good idea).
LVL 83

Expert Comment

ID: 38313523
What version PIA are you using? 2003? Try just reinstalling 2003.

Author Closing Comment

ID: 38313810
I did the uninstall the used CCleaner to clean the registry and finally started on safe mode and uninstalled all the office entries in the GAC. After I installed office 2003 and everything worked fine then installed office 2010 and everything seem to be working fine.
Thanks a lot!

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In Easy String Encryption Using CryptoAPI in C++ (http://www.experts-exchange.com/viewArticle.jsp?aid=1193) I described how to encrypt text and recommended that the encrypted text be stored as a series of hexadecimal digits -- because cyphertext may…
Article by: jpaulino
XML Literals are a great way to handle XML files and the community doesn’t use it as much as it should.  An XML Literal is like a String (http://msdn.microsoft.com/en-us/library/system.string.aspx) Literal, only instead of starting and ending with w…
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…
Is your OST file inaccessible, Need to transfer OST file from one computer to another? Want to convert OST file to PST? If the answer to any of the above question is yes, then look no further. With the help of Stellar OST to PST Converter, you can e…
Suggested Courses
Course of the Month15 days, 18 hours left to enroll

850 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question