Shifting cells up in Excel worksheet causes an exception in .NET

I have stumbled upon a problem which is very similar to a problem that I have reported previously: Like before, I receive "Specified argument was out of the range of valid values" at workbook.Save(...). I am using Aspose.Cells 8.2.2.0.

Hi Fredrik,

Thanks for your posting and using Aspose.Cells.

We were able to observe this exception after executing the following code with your source Excel file using the latest version: Aspose.Cells for .NET 8.3.0. ShiftType.Up causes exception on save while ShiftType.Left works fine without causing any exception.

We have logged this issue in our database for investigation. We will look into it and fix this issue. Once, the issue is resolved or we have some other update for you, we will let you know asap.

This issue has been logged as

  • CELLSNET-43171 - ShiftType.Up causes exception on save

C#

Workbook workbook = new Workbook(“DeleteRange3.xlsx”);


Range range = workbook.Worksheets.GetRangeByName(“Import_Construction_costs”);

Worksheet worksheet = range.Worksheet;


Cells cells = range.Worksheet.Cells;


//If ShiftType.Left is used, it works fine but ShiftType.Up gives exception

ShiftType shiftType = ShiftType.Up;

cells.DeleteRange(range.FirstRow, range.FirstColumn, range.FirstRow + range.RowCount - 1, range.FirstColumn + range.ColumnCount - 1, shiftType);


//Exception occurs here

workbook.Save(“output.xlsx”);


Exception:
at Aspose.Cells.Workbook.Save(String fileName, SaveOptions saveOptions)
at Aspose.Cells.Workbook.Save(String fileName)
An unhandled exception of type ‘System.ArgumentOutOfRangeException’ occurred in AsposeProject.exe

Additional information: Specified argument was out of the range of valid values.

Hi,

Thanks for your using Aspose.Cells.

Please download and try the latest fix: Aspose.Cells for .NET v8.3.0.2 and let us know your feedback.

That seems to do the trick, thank you!

I normally don’t use the fixes from Aspose, but rather wait for an offical release with the fix included.

Any ETA on when that may arrive?

/Fredrik

Hi Fredrik,

Thanks for your feedback and using Aspose.Cells.

The next official release will be published around 15th of December. However, you can use this release for your production use and should not face any issue.

The issues you have found earlier (filed as CELLSNET-43171) have been fixed in this update.


This message was posted using Notification2Forum from Downloads module by Aspose Notifier.