Hi,
Somehow while converting DataTable to WorkSheet, I am getting this exception. Not sure what exactly is causing this.
```
A first chance exception of type 'System.Runtime.InteropServices.ExternalException' occurred in System.Drawing.dll
System.Runtime.InteropServices.ExternalException (0x80004005): A generic error occurred in GDI+.
at System.Drawing.Graphics.MeasureString(String text, Font font, SizeF layoutArea, StringFormat stringFormat)
at System.Drawing.Graphics.MeasureString(String text, Font font, Int32 width, StringFormat format)
at ClosedXML.Utils.GraphicsUtils.MeasureString(String s, Font font)
at ClosedXML.Excel.FontBaseExtensions.GetWidth(IXLFontBase fontBase, String text, Dictionary`2 fontCache)
at ClosedXML.Excel.XLColumn.AdjustToContents(Int32 startRow, Int32 endRow, Double minWidth, Double maxWidth)
at ClosedXML.Excel.XLColumn.AdjustToContents(Int32 startRow, Int32 endRow)
at ClosedXML.Excel.XLColumns.<>c__DisplayClasse.<AdjustToContents>b__d(XLColumn c)
at System.Collections.Generic.List`1.ForEach(Action`1 action)
at ClosedXML.Excel.XLColumns.AdjustToContents(Int32 startRow, Int32 endRow)
at ClosedXML.Excel.XLWorksheets.Add(DataTable dataTable, String sheetName)
at XXXXX A first chance exception of type 'System.Runtime.InteropServices.ExternalException' occurred in XXXXX
```
Code Sample:
```
// Creating Excel workbook
var wb = new XLWorkbook(XLEventTracking.Disabled);
var dataSheet = wb.Worksheets.Add(dataTable, "Data");
```
The DataTable includes some null or empty cells as well as strings in different scripts like Chinese, Arabic, etc.
Any idea what might be the reason for this.
Somehow while converting DataTable to WorkSheet, I am getting this exception. Not sure what exactly is causing this.
```
A first chance exception of type 'System.Runtime.InteropServices.ExternalException' occurred in System.Drawing.dll
System.Runtime.InteropServices.ExternalException (0x80004005): A generic error occurred in GDI+.
at System.Drawing.Graphics.MeasureString(String text, Font font, SizeF layoutArea, StringFormat stringFormat)
at System.Drawing.Graphics.MeasureString(String text, Font font, Int32 width, StringFormat format)
at ClosedXML.Utils.GraphicsUtils.MeasureString(String s, Font font)
at ClosedXML.Excel.FontBaseExtensions.GetWidth(IXLFontBase fontBase, String text, Dictionary`2 fontCache)
at ClosedXML.Excel.XLColumn.AdjustToContents(Int32 startRow, Int32 endRow, Double minWidth, Double maxWidth)
at ClosedXML.Excel.XLColumn.AdjustToContents(Int32 startRow, Int32 endRow)
at ClosedXML.Excel.XLColumns.<>c__DisplayClasse.<AdjustToContents>b__d(XLColumn c)
at System.Collections.Generic.List`1.ForEach(Action`1 action)
at ClosedXML.Excel.XLColumns.AdjustToContents(Int32 startRow, Int32 endRow)
at ClosedXML.Excel.XLWorksheets.Add(DataTable dataTable, String sheetName)
at XXXXX A first chance exception of type 'System.Runtime.InteropServices.ExternalException' occurred in XXXXX
```
Code Sample:
```
// Creating Excel workbook
var wb = new XLWorkbook(XLEventTracking.Disabled);
var dataSheet = wb.Worksheets.Add(dataTable, "Data");
```
The DataTable includes some null or empty cells as well as strings in different scripts like Chinese, Arabic, etc.
Any idea what might be the reason for this.