If you would like to replace existing data, you need to go through these steps:
1) Create the instance of MS Excel application. How? You can use
Interop[
^] or
OLE Automation[
^].
2) Open existing workbook,
3) Clear existing data,
4) Export data from your application, using
for .. next
loop or
CopyFromRecordset[
^] method for Range object.
Personally, i prefer CopyFromRecordset
because it's quick ;)
5) Save and close the workbook. Use
Close[
^] method with parameter
SaveChanges:=True
That's all! Good luck ;)
Examples:
Opening and Navigating Excel with C#[
^]
http://csharp.net-informations.com/excel/csharp-open-excel.htm[
^]
If you would like to add some data in to existing collection, please let me know.