If I use Aspose.Cells for .NET version 19.6 or later.
The encrypted ODS file can’t be opened by OpenOffice.
Version before 19.6 is ok!
var workbook = new Workbook(“input.xls”);
workbook.Settings.Password = “12345”;
workbook.Save(“Output.ods”);
but XLSX to ODS is all OK!
@alberthung,
Which version you are using? Did you try using our latest version/fix (Aspose.Cells for .NET v24.1)? If you still find the issue with latest version, kindly do provide your OpenOffice version that you are using to open the output ODS file, we will check it soon.
Aspose.Cells for .NET version is 24.1(if downgrade to 19.5 is ok)
OpenOffice version is 4.1.15
Please try the uploaded xls file.
Thank you.
input.zip (6.2 KB)
@alberthung,
Thanks for the template file.
I tested your scenario/case using Aspose.Cells for .NET v24.1 with your input file and exact sample code, and it works fine. The output ODS file is fine tuned. When I opened the output ODS (attached) file into OpenOffice 4.1.15, I was prompted to enter the password. After I entered the valid password, the file is opened fine into it, see the screenshot attached.
sc_shot1.png (82.5 KB)
output.zip (5.9 KB)
This is a file that cannot be opened with OpenOffice after conversion by v24.1, but can be opened with LibreOffice. It is really strange.
output.zip (6.3 KB)
@alberthung
When I open the output ODS (attachment you provided earlier) file into OpenOffice 4.1.11, the system prompts me to enter a password. Please refer to the attachment. result.png (27.9 KB)
@John.He the password is 12345
Can it be opened?
@alberthung
Unable to open file properly after entering password. Did you set a license when saving files to ODS format? If the license is not set, OpenOffice will report a password error when opening ODS files. This should be a bug in OpenOffice.
The ods file generated through the following sample code can be opened normally in OpenOffice. Please refer to the attachment. output_net.zip (5.9 KB)
License l = new License();
l.SetLicense(@"E:\VSCellsForm\Aspose.Cells.NET.lic");
var workbook = new Workbook(filePath + "input.xls");
workbook.Settings.Password = "12345";
workbook.Save(filePath + "output_net.ods");
@alberthung ,
Your password is right. Your attached encrypted Ods file can’t be opened in OpenOffice. However, it can be opened in LibreOffice.
It seems that OpenOffice calculates different checksum for some stream with special length. (It seems it is a bug in OpenOffice since files can be opened in LibreOffice). If you change any part of the workbook, the calculated checksum will be changed and then OpenOffice can open the generated ods without any issue. For example, if you change a little in your source file. e.g. put value “TEST” to cell B1, the generated ods can be opened in OpenOffice. This also shows that only some special data and checksum value may trigger the bug of OpenOffice.
In the evolution process of our product, we continuously support more data and functionality. This will result in changes in the data and corresponding checksum of the generated ods files. For this specific file, the new data and checksum triggers this bug of OpenOffice.
The difference between your generated and @amjad.sahi generated Ods files is the same scenario. In our test we are using the licensed version, so there is no “Evaluation Warning” sheet and corresponding data. This difference may change the checksum and openoffice gave different result.
Anyway, we will investigate it more, and update you here if we have some news.
@John.He @peyton.xu ,
Thanks for your help. It’s really License issue.
My subscription only allows me to upgrade to v21.10 but I test this by the latest version v24.1.
I downgrade to v21.10, set license and encrypt the ods file, it can be opened by OpenOffice finally.
If I don’t set license, I must use LiberOffice.
@alberthung,
You are right. If you do not set (valid) license first, then the output ODS file cannot be opened into OpenOffice, which seems a bug in OpenOffice. Anyways, as @peyton.xu told you that we will investigate the issue in details.
Moreover, if you use Aspose.Cells for .NET v21.10 with your license and it works Ok, then you may keep using it for your needs. But, maybe you could not avail new enhancements we incorporated to newer versions for ODS file format.