<pre>foreach (IXLRow theRow in theworksheet.Rows()) { int row = theworksheet.LastRowUsed().RowNumber(); if (firstRow) { int cells = 0; foreach (IXLCell cell in theRow.Cells()) { cells++; if (cells > 27) { break; } else { dt3.Columns.Add(cell.Value.ToString()); } } firstRow = false; }
Quote:how to find and remove empty rows in closed xml
int lastrow = ws.LastRowUsed().RowNumber(); var rows = ws.Rows(1, lastrow); foreach (IXLRow row in rows) { if (row.IsEmpty()) row.Delete(); }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)