Link to home
Start Free TrialLog in
Avatar of pavelmed
pavelmed

asked on

File or assembly name Microsoft.Office.Interop.Excel, or one of its dependencies, was not found.]

I have an ASP.NET application created on my server that uses Microsoft.Office.Interop.Excel to dynamically create an Excel workbook.
It has a necessary reference, and was compiled and run OK on my server.

But when I moved the application to the network server where it is supposed to run, it failed to load because of the runtime error:
"File or assembly name Microsoft.Office.Interop.Excel, or one of its dependencies, was not found."

I copied ALL project files and directories from my server to the network server.
The application loads if the line uses the Microsoft.Office.Interop.Excel  is commented out.
The network server is Windows 2003 server.

What can I do to resolve the problem?

Thank you very much.
Avatar of prajeebkumar
prajeebkumar

if your dev or local box doesn't have office 2003, your application is probably refering to office 10.0 version dll.. but when you move to a 2003 box, you have the updated office 11.0 version.. since its a built in reference in .net, its probably not able to recognize the older version in 2003 box. You could install 2003 office version on your dev box and re-reference the excel interop assembly and that should solve your problem. I'm not sure if this is the best solution but unless you hear from someone else, you can try this.
One peice of advice for you.. Install Excel on your sever, problem fixed.
Avatar of pavelmed

ASKER

My local server has Office 2003 installed.  The applicatiom has a reference to 11.0 library.  Therefore it does not look like this a cause.
But network server does not have Office installed since it is used only as a web server, no workstation users.
I thought that the application's DLL could have contain all necessary info to use Excel since it was compiled on the box that does have the Office installed.
I am not in charge for the server, but I'll try asking somebody to install Excel on it.

Related question:
On my local server, I tried to search for the Microsoft.Office.Interop.Excel.DLL hoping that I could be able to copy it to the network server.
However, the search did not find Microsoft.Office.Interop.Excel.dll on my local box.
I had searched the entire drive including hidden and system folders.  
How is it possible?
ASKER CERTIFIED SOLUTION
Avatar of Jojo1771
Jojo1771

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Jojo1771,
I could not test it because I was suggested against installing Excel on the web server box because of company's specific reasons, so I'll need to redesign the application.
However I believe that your suggestion would help and therefore accept your answer.