我已使用以下代码隐藏,锁定列并添加了保护方法 如图所示,我需要允许插入,删除行。但是我无法在工作表中插入和删除行
Globals.Sheet1.Columns[4].Hidden = true;
Globals.Sheet1.Columns[4].Style.Locked = true;
Globals.Sheet1.Protect("",//password
true, //drawing objects
true, //Contents
true, //scenarios
true, //user interface
true, //format cells
true, //format columns
true, //format rows
true, //insert columns
true, //insert rows
Type.Missing, //insert hyperlinks
true, //delete columns
true, //delete rows
Type.Missing, //allow sorting
Type.Missing, //allow filtering
Type.Missing //allow pivot tables
);
Globals.Sheet1.Columns[1].Style.Locked = false;
Globals.Sheet1.Columns[2].Style.Locked = false;
Globals.Sheet1s.Columns[3].Style.Locked = false;