Hi there,
I love this product and am trying to use it more and more in my day to day
I have an excel file which has loads of empty rows at the end which I need to delete
When i use the IXLRows.Delete or the IXLRow.Delete (when looping through the rows) i have a major performance issue when it attempts the Delete
The code used here is
var lastRow = ws.LastRowUsed().RowBelow();
var lastUnUsedRow = ws.LastRow();
//ws.Range(lastRow.RangeAddress.FirstAddress.ToString(), lastUnUsedRow.RangeAddress.LastAddress.ToString()).Delete(XLShiftDeletedCells.ShiftCellsUp);
IXLRows rows = ws.Rows();
foreach (IXLRow row in rows)
{
if (row.IsEmpty(true))
{
row.Delete();
var lastUnUsedCell = ws.RowsUsed().Count();
}
}
The above code, which is deleting only one row, has been running for a good 7 minutes now and not completed yet.
Is there a better way to do this?
I'm using version version 0.69.1.0 of the DLL
Thank you
Comments: Attach the file you're using. Replace the text with garbage if you can't share the data.
I love this product and am trying to use it more and more in my day to day
I have an excel file which has loads of empty rows at the end which I need to delete
When i use the IXLRows.Delete or the IXLRow.Delete (when looping through the rows) i have a major performance issue when it attempts the Delete
The code used here is
var lastRow = ws.LastRowUsed().RowBelow();
var lastUnUsedRow = ws.LastRow();
//ws.Range(lastRow.RangeAddress.FirstAddress.ToString(), lastUnUsedRow.RangeAddress.LastAddress.ToString()).Delete(XLShiftDeletedCells.ShiftCellsUp);
IXLRows rows = ws.Rows();
foreach (IXLRow row in rows)
{
if (row.IsEmpty(true))
{
row.Delete();
var lastUnUsedCell = ws.RowsUsed().Count();
}
}
The above code, which is deleting only one row, has been running for a good 7 minutes now and not completed yet.
Is there a better way to do this?
I'm using version version 0.69.1.0 of the DLL
Thank you
Comments: Attach the file you're using. Replace the text with garbage if you can't share the data.