...
Encryption can be performed on the workbook level, as shown below:
Note | ||||||
---|---|---|---|---|---|---|
Code Block | ||||||
| ||||||
//--- To encrypt a workbook, use the Workbook.EncryptPassword property:
ExcelApplication xlw = new ExcelApplication();
Workbook wb = xlw.Create();
wb.EncryptPassword = "myPassword";
xlw.Save(wb, outPath);
|
How to Activate Worksheet Protection with ExcelWriter
...