C# ClosedXML WorkSheets Add's 1048576 empty rows
<p>I've been trying to find a solution for this but haven't been able to find any yet. So what is happening is that when I do:</p>

<p><code>IXLWorksheet sheetSave = wb.Worksheets.Add("SheetName");</code>    </p>

<p>I get an Excel sheet that as 1048576 rows and 20Columns. If I send a datatable same thing happens, it places the table but the sheet still as 1048576 rows, This makes the file have a size of 5MB with about 200x20 cells filled. </p>

<p>So does anyone know how to solve this? A way to force the range to a certain size, like the size o rows from the datatable.</p>

<p>Thank you,
any extra information just ask.</p>

<p>Added by request in answer:</p>

<p>Here is the method used to export the datatable to excel</p>

<pre><code>private void exportExcel(DataTable data)
    {
        XLWorkbook wb = new XLWorkbook();

        IXLWorksheet sheetSave = wb.Worksheets.Add(data, "list"); 

        DialogResult saveDialogResult = saveFileDialog1.ShowDialog();

        if ((saveDialogResult == DialogResult.OK) &amp;&amp; (saveFileDialog1.FileName != null))
        {
            wb.SaveAs(saveFileDialog1.FileName);
        }
    }
</code></pre>