Problems when clearing partial content of a table

Hi

I have an excel file that I want to modify. This file contains a table.

I want to delete all the table data rows except the last one (leave the colum headers and one data row).

With the remaining data row , I want to clear the content (only the content not the formating) of all the cells that are not formula cells.

I want all the formula cells to remain as they are.

when doing this , after I try and opening the saved file , excel gives an error message that data is corrupt - Attached are the original and saved files. Below is the code that does it.

{
w.Cells.DeleteRange(listObject.StartRow + 2, listObject.StartColumn, listObject.EndRow, listObject.EndColumn, ShiftType.Up);
}

//NOW clear content of last remaing data row except for the formula cells
foreach(Cell cell in w.Cells.Rows[listObject.StartRow + 1])
{
if(!cell.IsFormula)
{
cell.PutValue(null);
}
}

BTW - the same happens if I clear the content using

w.Cells.ClearContents(listObject.StartRow + 1, listObject.StartColumn, listObject.StartRow + 1, listObject.EndColumn - 1);

Please Help

Ryan

Hi,

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

I was able to replicate this bug using the following code with the latest version:
Aspose.Cells
for .NET v7.2.1.4



We have logged this issue in our database. Once it is fixed, we will soon let you know.

This issue has been logged as CELLSNET-40702.

I have attached both the source and output file for a reference. Please see the screenshot below

C#


string filePath = @“F:\Downloads\MyBook.xlsx”;


Workbook workbook = new Workbook(filePath);


workbook.Save(filePath + “.out3.xlsx”, SaveFormat.Xlsx);


Screenshot:

Thanks

Waiting for the fix.

This fix is also very important since we cannot allow any irelevant data to recide in the modified excel files.

Hi,


We normally provide fix at the end of week. Resolution of a problem depends on its complexity and our development team can give an approximation time for providing the fix after its analysis. I have logged your comments in our database, and once we get any update from our development team about your mentioned problem, we will let you know here by updating this thread.

Hi,

We have fixed this issue.

Please download and try the latest fix: Aspose.Cells for .NET v7.2.1.5

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


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