Encrypt ODS file with Aspose.Cells for .Net not work?

I refer to the example, but the saved ODS file is not password protected when opened.

Workbook workbook = new Workbook(sourceDir + “sampleODSFile.ods”);
workbook.Settings.Password = “1234”;
workbook.Save(outputDir + “outputEncryptedODSFile.ods”);

The strange thing is that Excel example using
workbook.SetEncryptionOptions(EncryptionType.XOR, 40)
workbook.Settings.Password = “1234”;

on ODS files is effective.

SetEncryptionOptions is necessary for ODS?
Which one should I use to encrypt ODS file?

@alberthung,

I tested your scenario/case using the following sample code with latest version/fix (Aspose.Cells for .NET v24.1, please try it(if you are not already using it)), it works fine and the output ODS file is Ok.
e.g.
Sample code:

Workbook workbook = new Workbook("g:\\test2\\Book1.ods");
workbook.Settings.Password = "1234";
workbook.Save("g:\\test2\\out1.ods");

Please find attached the input and output ODS files for your reference. Do you find any issue with the output ODS file if it is not protected/encrypted?
files1.zip (7.1 KB)

It is indeed a version problem. It works in version 18.7 or later. The version I purchased is 17.6. Thank you for your help.

@alberthung
You are welcome. If you have any questions, please feel free to contact us.