Encrypt And Decrypt ODS files
Contents
[
Hide
]
OpenOffice.org is a full-featured office suite which supports password-protecting and encrypting files. However encrypted ODS file can only be opened by OpenOffice after providing the password. Excel cannot open the encrypted ODS file and may raise warning message.The Encryption options are not applicable for ODS file unlike other file types.
Aspose.Cells allows to encrypt and decrypt ODS file. Decrypted ODS file can be opened both in Excel and OpenOffice,
Encrypt with OpenOffice Calc
- Select Save as and Click the Save With Password box.
- Click the Save button.
- Type your desired password into both the Enter Password to Open and Confirm Password fields in the Set Password window that opens.
- Click the OK button to save the file.
Encrypting/Decrypting ODS File:
For encrypting an ODS file, load the file and pass the actual password to WorkbookSettings.setPassword() before saving it. The output encrypted ODS file can be opened in OpenOffice only. For decrypting an ODS file, load the file by providing the password in the LoadOptions.setPassword(). Once the file is loaded, call function Workbook.unprotect() with actual password as argument and finally pass null to Workbook.getWorkbookSettings().setPassword().
Sample Code: