We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Password protection with ActionResult


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

1 Reply

AV Abirami Varadharajan Syncfusion Team July 31, 2017 09:45 AM UTC

Hi Clauido,  
Thank you for contacting Syncfusion support.  
We are able to reproduce the issue. A support incident to track the status of this defect has been created under your account. Please log on to our support website to check for further updates.   
Please let me know if you have any concerns.   

Live Chat Icon For mobile
Up arrow icon