Tuesday, November 08, 2005 9:40 PMHello everybody,
I'm looking in whole internet (and in this forum to) nothing completly works.
Ok, here is the problem.
In the project that i'm working on,
i have a:
1) "DataGrid1", which's DataSource is "DataSet1", which Contains one Table - "DataTable1". They all are empty, only the columns of "DataTable1" have names (for egz: "first_col",..."second_col")
2) Excel file on my Hdd - "c:\1.xls"
I need the program to
1) Load the contents of excel file to This "DataSet1" ("DataTable1"), so they could be seen on "DataGrid1"
...then user edits some of the contents in "DataGrid1"...
2) And then I want the program to save the edited contents of the "DataSet1" to save to other .xls file - for egz "c:\2.xls"
In other words - i need to open, edit and save an Excel file with my program.
p.s. contents of 1.xls and 2.xls are plain text of course (no pics, graphs or etc), but the solution of having .cvs file isn't good for me.
p.p.s. excuse me for my broken englinsh:)
Wednesday, November 09, 2005 12:16 AMHi,
The following articles on Excel Automation should help:
Wednesday, November 09, 2005 1:34 AMHi Vikram,
Dataset or Datatable doesn't support the .xls files directly. I also faced the same situation once. What i did is convert the .xls to collection object using MS-Office PIAs and assign the collection to dataset. After updating, u can save the Datastream of the datatable in Excel format.