title: C#, create excel 97-2003 (.xls) Interop
body: <p>using Excel = Microsoft.Office.Interop.Excel;</p>
  <p>I need to save a excel file (.xls) from my datagridview. All works fine, writing data, changing cell format etc. But problem appears while saving the doc.</p>
  <pre><code>string format = &quot;yyyy_MM_dd_HH-mm&quot;;
  string pathtoexport = @&quot;C:\DM\SMS\Przychodzace\Znalezione_SMS_&quot; + DateTime.Now.ToString(format) + &quot;.xls&quot;;
  oWB.SaveAs(pathtoexport, Excel.XlFileFormat.xlWorkbookNormal, missing, missing,
        false, false, Excel.XlSaveAsAccessMode.xlNoChange,
        missing, missing, missing, missing, missing);
      }
  </code></pre>
  <p>Well some days ago it was working, but now it can only say</p>
  <p>HRESULT: 0x800A03EC&quot;}</p>
  <p>I need .xls to import it to SQL. Any advices?</p>
  <hr />
  <p>Before the problem was at Excel.XlFileFormat.xlWorkbookDefault, when Iv changed it to Normal it was doing well. Now it doesnt work. LOst much time to handle it on my own with google, but I failed.</p>
  <pre><code>oWB.SaveAs(MyFile + @&quot;C:\SMS\XMLCopy.xls&quot;,
        Excel.XlFileFormat.xlWorkbookNormal, missing, missing,
        false, false, Excel.XlSaveAsAccessMode.xlNoChange,
        missing, missing, missing, missing, missing);
  </code></pre>