Index out of bound exception on Cell.PutValue

Hello,


We have a workbook and are trying to copy one named range and setting the Value for the cells in it to override the formulas. On one of those cells the Index out of bound exception is thrown.

Sample Code:

var tempWorkbook = new Workbook(“error.xlsx”);
Range range = tempWorkbook.Worksheets.GetRangeByName(“ABC”);

Workbook workbook = new Workbook();
Worksheet worksheet = workbook.Worksheets[0];
Range destinationRange = worksheet.Cells.CreateRange(0, 0, range.RowCount, range.ColumnCount);
destinationRange.CopyData(range);
destinationRange.Copy(range, new PasteOptions {SkipBlanks = false, PasteType = PasteType.All});
destinationRange.CopyStyle(range);

for (int i = 0; i < destinationRange.RowCount; i++)
{
for (int j = 0; j < destinationRange.ColumnCount; j++)
{
Cell cell = worksheet.Cells[i, j];
if (!cell.IsFormula)
continue;

object cellValue = cell.Value;
cell.PutValue(cellValue);
}
}

The workbook is attached

Best regards,
Stefan Botan,
IBM Romania

Hi Stefan,

Thanks for your posting and using Aspose.Cells.

We were able to observe this issue after running your sample code with your source Excel file using the latest version. The code throws exception on Cell.PutValue() method.

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-43393 - Index out of bound exception on Cell.PutValue

Hi,

Please try our latest version/fix: Aspose.Cells for .NET v8.3.2.3

We have fixed your issue now.

Let us know your feedback.

Thank you.

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


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