Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1825
  • Last Modified:

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.
  • 2
  • 2
1 Solution
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.
pavelmedAuthor Commented:
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?
You are right, That becaue the refrence is relally pointing to the Execl.exe, So trust me when I say that even if you had that  dll you still won't have 1/2 of what you need.
pavelmedAuthor Commented:
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.

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now