After deleting one row in worksheet and saving the Excel file becomes corrupted in .NET

Hi,

can you please help with the issue below?

Aspose.Cells version is 7.2.0.3.<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Delete one row in worksheet. Then save a workbook. The error exception occurs: ’Invalid row index’.

try

{

string input = "ExcelTestIn.xlsx";

string output = "ExcelTestOut.xlsx";

string fullPathIn = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), input);

string fullPathOut = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), output);

Workbook wb = new Workbook(fullPathIn);

Worksheet mySheet = wb.Worksheets[0];

Cells cells = mySheet.Cells;

cells.DeleteRows(0,1);

wb.Save(fullPathOut);

}

catch (Exception ex)

{

throw ex;

}

The sample application and work file are attached.

Thank you!

Hi,

Thanks for your posting and using Aspose.Cells for .NET.

We were able to replicate this issue using the latest version:
Aspose.Cells
for .NET v7.3.1.4
using the following sample code and your source file.

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

This issue has been logged as CELLSNET-41054.

I have attached the source file, the output file and the screenshot for your reference. Please also see the exception listed below.

C#


string filePath = @“F:\bin\Debug\ExcelTestIn.xlsx”;


Workbook wb = new Workbook(filePath);


Worksheet mySheet = wb.Worksheets[0];

Cells cells = mySheet.Cells;

cells.DeleteRows(0, 1);

wb.Save(filePath + “.out.xlsx”, SaveFormat.Xlsx);


Exception:
An unhandled exception of type 'System.ArgumentException' occurred in Aspose.Cells.dll

Additional information: Invalid row index.

Screenshot:

Since this is an urgent client case, I am just wondering is there any temporary workaround to get the file saved with existing code but changing somehow an excel row/ cells format or something else?

Any help is really appreciated.

Thank you.

Hi,


Please spare us some time (may be 2-3 days), hopefully we could fix it soon.

Anyways, I have also asked the relevant developer to suggest some workaround (if possible). Once we find any update from the developer, I will let you know here.

Thank you.

Hi,

We have fixed this issue.

Please download and try this fix: Aspose.Cells for .NET v7.3.1.5 and let us know your feedback.

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


This message was posted using Notification2Forum from Downloads module by aspose.notifier.