Click here to Skip to main content
15,889,116 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more: , +
C#
i have created a wcf service that uses excel file for doing some operation on it the problem is that when i host it on hosting site like somee or smarterasp it doesn't work as excel isn't installed on server how can i solve that?
Posted
Comments
Sergey Alexandrovich Kryukov 14-Dec-15 16:18pm    
Why? why?!
—SA

1 solution

Read the following Microsoft knowledgebase article:

Microsoft does not currently recommend, and does not support, Automation of Microsoft Office applications from any unattended, non-interactive client application or component (including ASP, ASP.NET, DCOM, and NT Services), because Office may exhibit unstable behavior and/or deadlock when Office is run in this environment.

The article documents the various hoops you'll have to jump through if you want to use Office interop from an ASP.NET application - and there's no guarantee that it will work, or that it won't stop working at some random point in the future.

There are various ways to read, create and manipulate Excel spreadsheets on the server without using Office interop, none of which require having Office installed on the server. For example:

Unfortunately, there's no automatic conversion. You will need to re-write your code.
 
Share this answer
 
v2
Comments
Sergey Alexandrovich Kryukov 14-Dec-15 16:20pm    
My 5 for useful information, but the root of the problem is naive assumption that some hosting providers should install Excel and, most likely, the use of Excel itself.
—SA
prince.Hassan22 19-Dec-15 17:00pm    
thanks for your answer i tried epplus and it works very good
but can you provide me with free library to convert excel files to pdf
Sergey Alexandrovich Kryukov 19-Dec-15 22:47pm    
Probably, you are commenting the comment of a wrong person.
—SA
Richard Deeming 4-Jan-16 8:26am    
I've not seen anything free; only commercial products.

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