Click here to Skip to main content
15,886,603 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
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

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.
 
Share this answer
 
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.
Thanks for your reply....

how can I call excel from IIS..?
 
Share this answer
 
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.
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
 
Share this answer
 
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, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900