[DevExpress Support Team: CLONED FROM T280482: Can I password protect an Excel file using ExportToXlsx?]
Hi,
Does DevExpress.Spreadsheet.Workbook provide save with password method?
Thanks.
Does DevExpress.Spreadsheet.Workbook provide save with password method
Answers approved by DevExpress Support
Hello,
Currently, we support adding a password to a saved document only while exporting the document to XLS format. Please refer to the following code:
C#Workbook wb = new Workbook();
wb.LoadDocument("test.xlsx");
wb.Options.Export.Xls.Password = "test";
wb.SaveDocument("test_password.xls", DevExpress.Spreadsheet.DocumentFormat.Xls);
For XLSX format, this functionality is not yet supported, because of complexity of supporting this feature for the mentioned format. We have this task in our TO-DO list, however, we have not yet decided in what exact version it will be implemented.
Do not hesitate to contact me if you have additional questions or need further assistance.