How to read / write Excel file using C#?
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 6 of 6

Thread: How to read / write Excel file using C#?

  1. #1
    Join Date
    Oct 2010
    Posts
    1

    Question How to read / write Excel file using C#?

    I want to read values from excel file and the results should be printed in that same excel file.
    I am using VS 2005 and MS Office 2003.

    Thanks in Advance!

  2. #2
    Join Date
    Apr 2004
    Location
    England, Europe
    Posts
    2,492

    Re: How to read / write Excel file using C#?

    Is this article any help? http://support.microsoft.com/kb/302084
    My hobby projects:
    www.rclsoftware.org.uk

  3. #3
    Join Date
    Feb 2013
    Posts
    2

    Re: How to read / write Excel file using C#?

    You can use a 3rd party libraries to work with Excel files in C#. For example you may look for this .Net component.

  4. #4
    Join Date
    Jul 2011
    Posts
    6

    Re: How to read / write Excel file using C#?

    Workbook book = new Workbook();
    book.LoadFromFile("..\\..\\test.xlsx",ExcelVersion.Version97to2003);
    book.Worksheets[0].Range["A7"].Value = "abc";

    I use an Excel library this project introduces: http://spreadsheet.codeplex.com/

  5. #5
    Join Date
    Feb 2011
    Location
    United States
    Posts
    1,000

    Re: How to read / write Excel file using C#?

    My strategy has been to always avoid excel files like the plague and write CSV (or TSV) files (link) to work with programatically. Alas, that is not always an option. But if, in your case, it is: consider it!
    Best Regards,

    BioPhysEngr
    http://blog.biophysengr.net
    --
    All advice is offered in good faith only. You are ultimately responsible for effects of your programs and the integrity of the machines they run on.

  6. #6

    Re: How to read / write Excel file using C#?

    There are Excel libs that can be imported to the program - these are standard stuff that are available in the internet and need not be posted in forums unless theres something to discuss CG does not create any languages or software - the MSDN is for that. CG allows one to brainstorm a problem after you've tried.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Azure Activities Information Page

Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This is a CodeGuru survey question.


Featured


HTML5 Development Center