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

Posted on 2006-04-06
Last Modified: 2011-04-14
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.
Question by:pavelmed
    LVL 3

    Expert Comment

    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.
    LVL 5

    Expert Comment

    One peice of advice for you.. Install Excel on your sever, problem fixed.

    Author Comment

    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?
    LVL 5

    Accepted Solution

    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.

    Author Comment

    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.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    Lots of people ask this question on how to extend the “MembershipProvider” to make use of custom authentication like using existing database or make use of some other way of authentication. Many blogs show you how to extend the membership provider c…
    One of the pain points with developing AJAX, JavaScript, JQuery, and other client-side behaviors is that JavaScript doesn’t allow for cross domain request for pulling content. For example, JavaScript code on could not pull conte…
    Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…
    Here's a very brief overview of the methods PRTG Network Monitor ( offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

    779 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

    Need Help in Real-Time?

    Connect with top rated Experts

    12 Experts available now in Live!

    Get 1:1 Help Now