You can use OLEDB to create and manipulate Excel files. Check this: Reading and Writing Excel using OLEDB.
Typical example:
using (OleDbConnection conn = new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\\temp\\test.xls;Extended Properties='Excel 8.0;HDR=Yes'"))
{
conn.Open();
OleDbCommand cmd = new OleDbCommand("CREATE TABLE [Sheet1] ([Column1] string, [Column2] string)", conn);
cmd.ExecuteNonQuery();
}
EDIT - Some more links:
- Hey, Scripting Guy! How Can I Read from Excel Without Using Excel?Hey, Scripting Guy! How Can I Read from Excel Without Using Excel?
- How To Use ADO.NET to Retrieve and Modify Records in an Excel Workbook With Visual Basic .NET
- Reading and Writing Excel Spreadsheets Using ADO.NET C# DbProviderFactory