Hello,
I would like to protect xls document with a password to prevent modification.
This is the code:
...
workbook.SetWriteProtectionPassword(db.Settings.FirstOrDefault(c => c.SettingCode.Equals("XLS_PASSWORD_PROTECTION")).SettingVal);
// Set the workbook as read-only.
workbook.ReadOnlyRecommended = true;
workbook.Version = ExcelVersion.Excel2013;
return excelEngine.SaveAsActionResult(workbook, work.WorkCode + ".xlsx", HttpContext.ApplicationInstance.Response, ExcelDownloadType.PromptDialog, ExcelHttpContentType.Excel2013);
The xls document is generated correctly, but when I open it (it is downloaded from browser) I can modify it without password protection.
How can I solve the problem?
Thanks. Claudio