Reading Excel

Posted on 2012-09-11
Last Modified: 2012-10-10

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.

Question by:rajeeva_nagaraj
    LVL 69

    Assisted Solution

    by:Éric Moreau
    with a 3rd party component like, you don't need Excel to be installed
    LVL 30

    Accepted Solution

    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.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How to improve team productivity

    Quip adds documents, spreadsheets, and tasklists to your Slack experience
    - Elevate ideas to Quip docs
    - Share Quip docs in Slack
    - Get notified of changes to your docs
    - Available on iOS/Android/Desktop/Web
    - Online/Offline

    Summary Displaying images in RichTextBox is a common requirement with limited solutions available. Pasting through clipboard or embedding into RTF content only support static images.  This article describes how to insert Windows control objects int…
    This article describes relatively difficult and non-obvious issues that are likely to arise when creating COM class in Visual Studio and deploying it by professional MSI-authoring tools. It is assumed that the reader is already familiar with the cla…
    Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…
    This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor ( If you're looking for how to monitor bandwidth using netflow or packet s…

    761 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    10 Experts available now in Live!

    Get 1:1 Help Now