Free Support Forum - aspose.com

20.8 > 20.9 change/bug - worksheet.Cells.DeleteRange only deletes first line

In 20.8 I deleted data in a worksheet in an existing workbook the following way:

var workbook = new Workbook($@"{path}\delete-data.xlsx");
var worksheet = workbook.Worksheets["data"];
var range = worksheet.Cells.MaxDisplayRange;
worksheet.Cells.DeleteRange(
range.FirstRow, range.FirstColumn,
range.RowCount, range.ColumnCount, ShiftType.Up);

In 20.9 the same code only deletes the first line. even if the range is correctly detected.

Is this a change, a bug or am I using the code incorrectly?

/Morten

@mortenma,
This issue is reproduced and logged in our database for further investigation. We will notify you here once any update is ready for sharing.

This issue is logged as:
CELLSNET-47616 - Delete Range behaving differently between v20.8 and v20.9

Thanks, Ahsan for your quick response.
In our case, we opted to replace workheet.Cells.DeleteRange with workheet.RemoveAt
/Morten

@mortenma,

I guess you meant WorksheetCollection.RemoveAt() method. Anyways, we are working your original issue and hopefully it will be figured out soon.

@mortenma,

Please try our latest version/fix: Aspose.Cells for .NET v20.9.6 (attached)

Your issue should be fixed in it.

Let us know your feedback.
Aspose.Cells20.9.6 For .Net2_AuthenticodeSigned.Zip (5.4 MB)
Aspose.Cells20.9.6 For .Net4.0.Zip (5.4 MB)
Aspose.Cells20.9.6 For .NetStandard20.Zip (5.4 MB)

The issues you have found earlier (filed as CELLSNET-47616) have been fixed in Aspose.Cells for .NET v20.10. This message was posted using Bugs notification tool by Amjad_Sahi. You may also get the version @ Nuget repos. (https://www.nuget.org/packages/Aspose.Cells/20.10.0).