1
Answer

reading excel file using WCF Service

Saugat K.C.

Saugat K.C.

10y
1.5k
1
I am trying to read excel file which is located in my local server directory using WCF service. I tried implementing using Microsoft.Office.Interop.Excel as well as OfficeOpenXML references but both of them cannot be imported in WCF service. I just have to read certain cells in the excel sheet. 
How to implement this in WCF service. Any help will be highly appreciated.
Answers (1)
0
Sharon Thompson
NA 16 0 10y
There are some known issues with server-side Office client automation so the best practice is to avoid using Excel Interop with .NET applications on server-side.

One of the alternatives in to use use the Open XML SDK combined with Word Automation Services.
You can find some additional resources about this approach here.

Another alternative would be to use some library that supports server side, for example you can try out this .NET library for excel files processing. It does not require automation services and has no dependency with Office.
Also here is an article about how to read Excel files in C# with it.