Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8821059
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T05:45:38+00:00 2026-06-14T05:45:38+00:00

I want to read excel file in my C#,WPF application. which is running on

  • 0

I want to read excel file in my C#,WPF application. which is running on different machines having different versions of excels(some has excel-2003 while some machines have excel-2007 etc and some machines doesn’t have any office installed at all). I want to read excel file content regardless of with/without any excel versions/packages installed on the target machines.

I am currently using Microsoft.Office.Interop.Excel to read data from excel file but on running my app on target machine which doesn’t have any office installed, my application doesn’t work.

How can I do it?
I am doing it the following way, added namespaces

 using Excel = Microsoft.Office.Interop.Excel;

Here comes the method’s body:

Excel.Application xlApp = new Excel.Application();
            Excel.Workbook xlWorkBook;
            Excel.Worksheet xlWorkSheet;
            Excel.Range range;
            xlWorkBook = xlApp.Workbooks.Open(_filePath);
            List<string> Folders = new List<string>();
            try
            {
                xlWorkSheet = (Excel.Worksheet)xlWorkBook.Worksheets.get_Item(1);
                range = xlWorkSheet.UsedRange;


                for (int cCnt = 1; cCnt <= range.Columns.Count; cCnt++)
                {
                    Folders.Add(((range.Cells[1, cCnt] as Excel.Range).Value).ToString());
                }
            }
            catch (Exception ex)
            {
                //some error msg
            }
            finally
            {
                xlWorkBook.Close();
                xlApp.Quit();
            }
            return Folders;
        }
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T05:45:39+00:00Added an answer on June 14, 2026 at 5:45 am

    There are some solutions already here:

    How to open an Excel file in C#?

    If you are developing open source application, there are some third party libraries, so take a look at the following:

    • http://exceldatareader.codeplex.com/
    • http://excellite.codeplex.com/
    • http://excelwrapperdotnet.codeplex.com/
    • http://netoffice.codeplex.com/
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using Apache POI 3.6, I want to read an excel file which has
I have a desktop application which has to read an excel file (either .xls
I want my web application users to download some data as an Excel file.
i want to read the 2010 excel file in java using apache poi api
I have an excel file and I want to read each column and create
i want to read an html file by using jquery get function, replace some
I want to read from an excel file in C. The excel 2007 file
I'm using vb.net 2003 and I want to read excel file 2003 using OleDb
I want to read simple excel xml file to dictionary. I have tried to
I want to read to my WEBApplication excel file, I found a way to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.