Excel found unreadable content in '.xlsx'

Hi,

We have an existing working application to generate excel files which is built on 5.1.3 Aspose.Cells for .Net.

The generated excel file contains some data in A1, A2, A3, A4, A5 rows.

We have used importDataReader and importDataTable to import the data into worksheet cells starting from A7, A6 is Header row.

Now, as part of an enhancement, we need to format the imported range of data cells (Starting from A7 to sheet.Cells.MaxDataRow) to have a "TableStyleMedium17". For this we have used to below code piece to do the work after import the datareadr or datatable.

// DataTable Version

int importedRowCount = sheet.Cells.ImportDataTable(inTable, format.DisplayDataTableColumnNames, format.DataTableStartColumn + startRowForRecords);

// DataReader Version

int importedRowCount = sheet.Cells.ImportDataReader(dr, format.DisplayDataTableColumnNames, startRowForRecords-1, 0, false);

// After import the data, lets set the tablestyle property

//Adding a new List Object to the worksheet

Aspose.Cells.Tables.ListObject listObject = sheet.ListObjects[sheet.ListObjects.Add("A7", "E15", true)];

//Adding Default Style to the table

listObject.TableStyleType = Aspose.Cells.Tables.TableStyleType.TableStyleMedium17;

// After the above code we save the workbook using one of the like wb.Save methods.

When we try to open the saved work book it is giving the below warning saying that

"excel found unreadable content in '.xlsx'. Do you want to recover the contents of this workbook? If you trust the source of this workbook, click yes.", when we try to open the workbook the actual tablestyletype is not applied and is being removed in the process of recovering the excel file.

With out creating the ListObject and set the TableStyleType the workbook opens perfectly.

1) What is the actual reason for this to happen?

2) We need a quick help to solve this issue and yet achieve the enhancement discussed before.

3) Most importantly, this is a urgent requirement for us, and not possible to send any sample projects. SO please help us in solving the said issue.

Looking forward gor Quick help.

Regards,

Pavan Kumar R


This message was posted using Aspose.Live 2 Forum

Hi Pavan,

We have tried to reproduce the issue mentioned by you. We used Aspose.Cells5.1.4.5 to test the scenario. It worked fine with this version. Please use the attached updated version Aspose.Cells5.1.4.5. If you still face any difficulty, please feel free to contact us. We are attaching output file for your consideration.

Thanks,