System.InvalidCastException: QueryInterface for interface Excel._Application failed.

This one has me stumped, hopefully not for much longer.  Here is the situation:  A .NET web application pulls data into a sql data reader , then creates, populates, and saves an Excel File.  This error is being thrown when the application runs on the server.  This error does not occur when it is in the debugger.  I even created a modified version of the program to run on my development box (release version) and ran it with no problems.  So it looks like the object cannot be created on the server Windows 2000 for some reason, here is the kicker: It has been working fine for about two years and suddenly broke.  Any ideas?

Thanks in advance-
LVL 4
ndegioiaAsked:
Who is Participating?
 
existenz2Commented:
That is definatly the problem. I would install Excel 2003 on the server to upgrade it and not downgrade your code to work with 2002.
0
 
existenz2Commented:
Is Excel installed on the server?

This is required for creating Excel files and are the Excel versions the same?
0
 
ndegioiaAuthor Commented:
Yes MS Office 2002 is installed on the server.  The applicaiton is using the Microsoft.Office.Core object Library 11.0.  The Execl version on my dev box is 2003.  Do you think the object library needs to be for 2002; possibly Microsoft.Office.Core object Library 10.0?  Is there a way it can work with both?

Thanks
0
 
ndegioiaAuthor Commented:
Thanks, I will give that a try.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.