"Excel cannot open the file ... because the file format ... " after upgrading from 23.3 to 24.6

Hi,
I have upgraed aspose cells Java from 23.3 to 24.6 and I am getting an error while opening an xlsx file created with aspose in Micsorosft Excel:

Excel cannot open the file output.xlsx because the file format or file extension is not valid. Verify that the file has not been corrupted and that the file extension matches the format of the file.

There is no such problem if I use 23.3. If I change the extension of the file to “xls” then the problem disappears.
Also, I use XlsSaveOptions opt = new XlsSaveOptions(SaveFormat.XLSX);

Could you pleas help with this issue?

@r2mzes,

The line of code is wrong. Could you please change the line to:

OoxmlSaveOptions opt = new OoxmlSaveOptions(SaveFormat.Xlsx);

Let us know with details if you still find the issue.

1 Like

You are right. It works after applying the change you suggsted :slight_smile: Thank you for a quick response :slight_smile:

@r2mzes,

It’s great to hear that the suggested line of code resolved your issue. Please don’t hesitate to reach out if you have any further questions or comments.