title: Export a DataTable to an existing Excel
body: <p>I need to open an <strong>existing Excel</strong> file and fill it with a <strong>DataTable</strong>.
  How can I do that?</p>
  
  <p>I am working in ASP.NET</p>
  
  <p>I have already tried to create an excel with this solution (http://stackoverflow.com/questions/1746701/export-datatable-to-excel-file)
  and then I tried to open it with an OLEDB connection like this, but it didn't work.. it said that the table was not in a correct format.. and then it said that ir couldn't find the ISAM file.. I don't know what to do..</p>
  
  <pre><code>System.Data.OleDb.OleDbConnection conn = new System.Data.OleDb.OleDbConnection(@"Provider=Microsoft.Jet.OLEDB.4.0;DataSource=C:\reports\report.xls;Extended Properties=""Excel 8.0;HDR=No;IMEX=1""");
  
  conn.Open();
  System.Data.OleDb.OleDbCommand cmd = new System.Data.OleDb.OleDbCommand();
  cmd.Connection = conn;
  
  cmd.CommandText = @"SELECT * INTO [Excel 8.0;Database=C:\reports\reportBase.xls].[SheetBase1] FROM Sheet1]";
  
  cmd.ExecuteNonQuery();
  conn.Close();
  </code></pre>
  
  <p>Please help me!! I'm desperate!!</p>
  
  <p>Thank you!!</p>