Build 4.0.0.96 of xlsgen adds read and write support for protected ranges in XLS, XLSB and XLSX files.
Protected ranges, as the name implies, was introduced back in Excel 2003 for making it easier to create editable data in ranges, while still maintaining security (password and domain-based account names).
xlsgen exposes this in the object model. A protected range can be created from a regular range with a single method call. Setting a password is optional. Setting security by naming domain-based accounts who are indeed allowed to edit cells inside those ranges, is also optional. Of course, both the password and the domain-based account names provide value for controlling what's going on when Excel files are deployed accross the organization. This is indeed a very corporate-centric feature.
Here is how to create a protected range :
IXlsProtectedRange pr = worksheet.NewRange("B11:D14;F11:H14").ProtectedRange;
pr.Password = "aaa";
pr.AddUserOrGroup("stef"); // domain-based account name
As a bonus, protected ranges also appear in the automatic source code generator.