We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Workbook.FileFormat property returns wrong formats

Hi, Amjad Sahi.

In my scenario I detect format of MS office files (they originally have temporary names without extensions). My job is to detect file format type and add corresponding extension. I tried using DetectFileFormat method of Aspose.Cells.FileFormatUtil and FileFormat property of Workbook object.

And they return different values for regular (not encrepted) XLTM and XLTX files. DetectFileFormat method returns correct value, but FileFormat property returns XLSM and XLSX accordingly.

It is really important to get correct format, because MS Office does not open XLTM (XLTX) with extension changed to XLSM (XLSX): it will show error message "Excel cannot open the file because the file format or file extension is not valid. ...".

Knowing this specificity I can use DetectFileFormat method for regular XLTM and XLTX files instead of FileFormat property.

But it does not work with encrypted ones, because for clear reasons DetectFileFormat method returns Ooxml. So in addition to wrong value returned by FileFormat property I face with inability to get correct extension, which leads to MS Excel error.

I attached sample files and code snippet.

Please review it and let me know if it is bug.

I will create separate ticket, if needed.

Thanks,
Alex Shloma

Hi Alex,

Thanks for your posting and using Aspose.Cells.

I have split this thread from the main thread: Aspose incorrectly determines file format.

We were able to observe this issue using the latest version: Aspose.Cells
for .NET v8.0.2.2
and found Workbook.FileFormat property returns incorrect format. For encrypted XLTM and XLTX file, DetectFileFormat() returns OOXML which
is fine, but when it is loaded then
Workbook.FileFormat property returns (XLSM and XLSX) format which is
wrong.


We have logged this issue in our database for investigation. We will look into it and fix this issue if possible. 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-42684.

Hi Alex,

Thanks for using Aspose.Cells.

a) We will fix the issue that Workbook.FileFormat does not return Xltx file
format.

b) If you open the encrypted files with correct password, Aspose.Cells
returns the file format of decrypted files, not “Ooxml”.

Hi Shakeel Faiz,


That’s good news about Workbook.FileFormat.

Can you please give an approximate time needed to fix XLTX, XLTM bug?

>>If you open the encrypted files with correct password, Aspose.Cells returns the file format of decrypted files, not “Ooxml”.

Yes, I know it. Ooxml is returned by FileFormatUtil.DetectFileFormat method.


Thanks,
Alex Shloma

Hi Alex,

Thanks for your posting and using Aspose.Cells.

Currently, we cannot provide you any estimated time. But it might take a week or so. Please spare us some time. Once, we will have some news for you, we will let you know asap.

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


This message was posted using Notification2Forum from Downloads module by Aspose Notifier.

Tested Cells 8.1.0 on my side. Correct value is returned.


Thanks for your job guys.

Best regards,
Alex Shloma

Hi,


Thanks for your feedback.

Good to know that your issue is resolved by the new fix/version. Feel free to contact us any time if you need further help or have some other issue or queries, we will be happy to assist you soon.

Thank you.