I have a small program to insert rows in an existing excel file. On certain columns it is formatted a certain way such as centering bold face and Number columns. When I pull data into the excel file from an external source within excel the formatting is preserved. But when I use C# to push data into the excel file the formatting is stripped. Here is the code I am using
using (OleDbConnection conn = new OleDbConnection(string.Format(@"Provider=Microsoft.ACE.OLEDB.12.0;Data Source={0};Extended Properties=""Excel 12.0 Xml;HDR=YES"";Jet OLEDB:Engine Type=37", exportPath)))
{
conn.Open();
OleDbCommand comm = new OleDbCommand(q, conn);
comm.Parameters.AddWithValue("@MyNumber", record.MyNumber);
comm.Parameters.AddWithValue("@Revision", record.RevisionChange);
comm.ExecuteNonQuery();
}
Any ideas