Free Support Forum - aspose.com

Xlsx save issue

Hi,

I am using Aspose.Cells version 5.3.2.0., I have made a function with the following code in order to save in xlsx format some old xls format workbooks.

Code sample:
Workbook workbook = new Workbook(_fileName);
string outputFileName = Path.Combine(Path.GetDirectoryName(_fileName), Path.GetFileNameWithoutExtension(_fileName) + ".xlsx");
workbook.Save(outputFileName);

When I use this function with some workbooks, the following exception occurs:
System.NullReferenceException: La référence d'objet n'est pas définie à une instance d'un objet.
à Aspose.Cells.Workbook.Save(String fileName, SaveOptions saveOptions)
à Aspose.Cells.Workbook.Save(String fileName)
à TestAspose.Form1.SaveXslInXslx() dans C:\ProjetTest\TestAspose\TestAspose\Form1.cs:ligne 872

I join a workbook wich reproduce the exception.

Can you try to fix this issue, please.

Gregory

Hi Gregory,


Thank you for reporting. We are able to re-produce your said issue and we have logged it in our Bug Tracking System under ID CELLSNET-26757.
We will soon get back to you on this.

Hi ,

Please try the new fix Aspose.Cells for .NET v5.3.2.8.

We have fixed the issue of throwing exception.

But MS Excel could not open the generated file because there some invalid data in the template file.

Even Ms Excel will throw an exception when converting this template file to xlsx file.

Could you show us how to create such a file?

Hi,

I have tried the fix, and it works well, thanks.

About the file, I don't know exactly how it has been created, I am not the author. But I know that it is an old workbook, probably created with excel 95 and since it has been converted in new excel versions several times. It is surely the reasons why it contains some invalid data.

I will clean up the workbook and with your fix, I think I can convert it in xslx or xlsm and work with it.

Regards,

Grégory