trying to insert data to Excel file using OLEDB

I want a button in c# form to be able to insert data to excel table.

this is what i did…

try
            {
                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:\\Users\\Miko\\Documents\\WeightWatchers - Copy\\TrackingLoss.xlsx';Extended Properties=Excel 8.0;");
                MyConnection.Open();
                myCommand.Connection = MyConnection;
                sql = "Insert into [Sheet1] (Date,Loss) values(y,x)";
                myCommand.CommandText = sql;
                myCommand.ExecuteNonQuery();
                MyConnection.Close();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
            }

when im trying it this window is open

alt text

anybody knows why and what to do?

you can use Uni-Excel Package for Read, Write, and edit excel files