Reading Excel


I have written a c# winfoms application, which can read data from excel file. I have used oledb to connect to excel files. When i tried deploying that to one of our client system, i found that there is no MS office installed in that system, hence it is throwing an error if i run the exe. Can anyone suggest me what should i do in this case. its bit urgent please.

Who is Participating?
You can use any one of a growing number of free .Net libraries to do this. Here are a few examples:

EPPlus: Example
NPOI: Example : More Examples

What's nice with these libraries is that they do not use Excel Automation, which would require Excel to be installed on the server and generally is not scalable.

Anyway, once you've managed to read the data, you can loop through the cells in the desired worksheet and write them out as HTML.

Another approach here is to read the Excel file into a dataset using ODBC and then looping through the dataset and writing the data out as HTML.

GemBox have a .NET Excel Manipulation library which you can also look at. They have a free version, limited to a maximum of 150 rows per worksheet and 5 worksheets per workbook. If your data meets, then it's worth a try.
Éric MoreauSenior .Net ConsultantCommented:
with a 3rd party component like, you don't need Excel to be installed
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.