I am exporting data in Excel form using EPPLUS Excel Library. I want that when excel downloaded it will ask for password. I have tried following code.
If you are saving the excel package into a MemoryStream (for sending as an email attachment) you have to do this:
excelPackage.SaveAs(memoryStream, "pa$$w0rd");