I guess data didn't insert on the excell sheet. For my case i am doing like that,
System.Data.OleDb.OleDbConnection MyConnection ;
System.Data.OleDb.OleDbCommand myCommand = new System.Data.OleDb.OleDbCommand();
string sql = null;
MyConnection = new System.Data.OleDb.OleDbConnection("provider=Microsoft.Jet.OLEDB.4.0;Data Source='c:\\csharp.net-informations.xls';Extended Properties=Excel 8.0;");
MyConnection.Open();
myCommand.Connection = MyConnection;
sql = "Insert into [Sheet1$] ([id],[name]) values ('1','e')";
myCommand.CommandText = sql;
myCommand.ExecuteNonQuery();
MyConnection.Close();
And to Open the Excell sheet you might use Workbooks.Open Method
Workbook Open(
[In] string Filename,
[In, Optional] object UpdateLinks,
[In, Optional] object ReadOnly,
[In, Optional] object Format,
[In, Optional] object Password,
[In, Optional] object WriteResPassword,
[In, Optional] object IgnoreReadOnlyRecommended,
[In, Optional] object Origin,
[In, Optional] object Delimiter,
[In, Optional] object Editable,
[In, Optional] object Notify,
[In, Optional] object Converter,
[In, Optional] object AddToMru,
[In, Optional] object Local,
[In, Optional] object CorruptLoad
);
This something like this,
Application excel = new Application();
Workbook workbk = excel.Workbooks.Open(......);
Lemme know if it is helpful to you or if you need any assistance for this.
Thanks,
Rashim