HotXLS 文档

Protection permission properties

这些 Boolean 属性控制受保护经典 XLS 工作表保存在 BIFF8 SheetProtect 记录中的逐操作权限。请在保存工作簿之前设置它们;调用 Protect to enable worksheet protection

语法

property AllowEditObjects: Boolean;
property AllowEditScenarios: Boolean;
property AllowFormatCells: Boolean;
property AllowFormatColumns: Boolean;
property AllowFormatRows: Boolean;
property AllowInsertColumns: Boolean;
property AllowInsertRows: Boolean;
property AllowInsertHyperlinks: Boolean;
property AllowDeleteColumns: Boolean;
property AllowDeleteRows: Boolean;
property AllowSelectLockedCells: Boolean;
property AllowSort: Boolean;
property AllowAutoFilter: Boolean;
property AllowPivotTables: Boolean;
property AllowSelectUnlockedCells: Boolean;

Default values

AllowSelectLockedCells 和 AllowSelectUnlockedCells 默认为 True 其余权限属性默认为 False

示例

Sheet.AllowDeleteRows := True;
Sheet.AllowInsertRows := True;
Sheet.AllowAutoFilter := True;
Sheet.Protect('mypass123');

请参阅