diff --git a/ClosedXML/Excel/Cells/XLCell.cs b/ClosedXML/Excel/Cells/XLCell.cs index b1bcad9..7aaeacf 100644 --- a/ClosedXML/Excel/Cells/XLCell.cs +++ b/ClosedXML/Excel/Cells/XLCell.cs @@ -858,8 +858,11 @@ maxCo - 1); if (createTable) + // Create a table and save it in the file return tableName == null ? range.CreateTable() : range.CreateTable(tableName); - return tableName == null ? range.AsTable() : range.AsTable(tableName); + else + // Create a table, but keep it in memory. Saved file will contain only "raw" data and column headers + return tableName == null ? range.AsTable() : range.AsTable(tableName); } return null; @@ -905,9 +908,12 @@ ro, co - 1); - if (createTable) return tableName == null ? range.CreateTable() : range.CreateTable(tableName); - - return tableName == null ? range.AsTable() : range.AsTable(tableName); + if (createTable) + // Create a table and save it in the file + return tableName == null ? range.CreateTable() : range.CreateTable(tableName); + else + // Create a table, but keep it in memory. Saved file will contain only "raw" data and column headers + return tableName == null ? range.AsTable() : range.AsTable(tableName); } public XLTableCellType TableCellType() @@ -960,7 +966,6 @@ rowNumber++; } - void resetRecordPosition() { if (transpose)