export data to Excel sheet RRS feed

  • Question



    We have a requirment to export data to predefined excel sheet.  How can i do this.  The format of excel sheet is already given, i want to add record in that.  This is windows based application using C#2.0.  How i will implement this. 


    Excel Format like:

                                               Company Name

    Date:            MM/DD/YYYY

    User Name:  Selvakumar


    Cell1                         Cell2                                    Cell3                             Cell4                    Cell5

     1                               A                                        B                                   C                        D

     2                               G                                        H                                   I                         J


    The format is same in all case, only cell data is changing.  How can I implement this task.  How can i create copy of the template excel sheet and write values in particular cell.


    Selvakumar R


    Friday, April 11, 2008 6:39 AM


  • I would recommend ExcelPackage...
    Friday, April 11, 2008 9:43 AM

All replies

  • I would recommend ExcelPackage...
    Friday, April 11, 2008 9:43 AM
  • Thanks for your information. 

    Can you tell me from where we will get "OfficeOpenXml" reference.  Please tell me the location from where I will download "OfficeOpenXml".  I am using Visual studio 2005, whether this tool will support VS 2005.

    Thanks in advance.



    Selvakumar R

    Tuesday, April 15, 2008 8:50 AM
  • You could download the library (dll) from here:  (

    Or you could download the source package and build it yourself.

    Now that you have the library it is only a matter of adding it to your project, which can be done as following:

    To add a reference in Visual C# or Visual J#

    1. In Solution Explorer, right-click on the project node and click Add Reference.

    2. In the Add Reference dialog box, select the tab indicating the type of component you want to reference.

    3. Select the components you want to reference, then click OK.

    Wednesday, April 16, 2008 5:36 AM