title: Getting "Insufficient memory " exception on exporting large data table to excel
body: <p>I have a data table which contains more than 125 000 records. I am trying to export this data table into an excel file. If the record count is less, then my code works perfectly. But in this case, the system is throwing the below exception:</p>
  
  <blockquote>
    <p>Insufficient memory to continue the execution of the program</p>
  </blockquote>
  
  <p>Below is the code segment where the exception is thrown.
  rawData is a 2 dimensional array made out of my data table.</p>
  
  <pre><code>Dim excelRange As String = String.Format("A1:{0}{1}", finalColLetter, dt.Rows.Count + 1)
  excelSheet.Range(excelRange, Type.Missing).Value2 = rawData
  </code></pre>
  
  <p>Is there any way to handle such large data?</p>