I know this question is very old but i am not finding any answer to this.
How to append values into existing excel file and to a particular column.
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=filelocation;Extended Properties=Excel 8.0;");
MyConnection.Open();
myCommand.Connection = MyConnection;
sql = "Insert into ["+ sheetname +"$] (Result) values ("+ result +")";
myCommand.CommandText = sql;
myCommand.ExecuteNonQuery();
MyConnection.Close();
I even tried different method like opening Excel through C# and append, nothing worked.
If you don’t have to use
OLEDBhere is a good article how to operate excel files by using early binding.