Click here to Skip to main content
14,239,046 members
Rate this:
Please Sign up or sign in to vote.
See more:
I am generating excel from .net application.
In local system everything working fine.
In server system,getting error with the pages of excel code.

In server I don't have installed MS office and don't have permissions to install MS office.

Error I am getting:

Retrieving the COM class factory for component with CLSID {00024500-0000-0000-C000-000000000046} failed due to the following error: 80070005.

Source Error:

Line 39: Excel.Application objXL = new Excel.Application();


To avoid this error I have added one assembly in web.config

<add assembly="Microsoft.Office.Interop.Excel, Version=11.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c">

if I add this entry in web.config then it's giving me following error

could not load file or assembly 'microsoft.office.interop.excel version 11.0.0.0 culture neutral, PublicKeyToken=71e9bce111e9429c' or one of its dependencies. The system can not find the specified.


please suggest me solution for this problem

which dll's I should inculde in the bin and what other changes I need to do for this
Posted
Rate this:
Please Sign up or sign in to vote.

Solution 1

Not having MS Office on the server will be a problem, and are you using IIS?

It will work locally, for I assume you have Office on the machine, but when it is trying to access from the server it will run into a 'Cannot Find' situation.

Use IIS to call the Excel from your machine, or, better still, get permission and put the office suite on the server.
   
v2
Comments
Immaculate Perception 22-Jul-11 5:17am
   
Yes, agreed. Especially the Office on the Server for it has more than the main apps, it has all the connectivity.
Rate this:
Please Sign up or sign in to vote.

Solution 2

Thanks for your reply....

how can I call excel from IIS..?
   
Comments
Dave Kreskowiak 22-Jul-11 13:42pm
   
You're already doing it. You have to install Office on the server to get this to work. Try to remotely connect to an Office installation on another machine is problematic at best.
Rate this:
Please Sign up or sign in to vote.

Solution 3

Either Install Office suite on server or register DLL in GAC
Put your DLL "Interop.EXCEL" in GAC (just drag and drop DLL to C:\Windows\Assembly).

Hope it helps
   
Comments
Dave Kreskowiak 22-Jul-11 13:40pm
   
He has to have the Office Suite installed. There's no getting around that. There's no reason to use the GAC here.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100