//无效-行锁定
_gcSpread.ActiveSheet.Protect = true;
_gcSpread.ActiveSheet.DefaultStyle.Locked = false;
_gcSpread.ActiveSheet.Rows[0].Locked = true;
_gcSpread.InvalidateSheet();
//有效-单元格锁定
_gcSpread.ActiveSheet.Protect = true;
_gcSpread.ActiveSheet.DefaultStyle.Locked = false;
_gcSpread.ActiveSheet.Cells[0, 0].Locked = true;
_gcSpread.InvalidateSheet();
//无效-列锁定
_gcSpread.ActiveSheet.Protect = true;
_gcSpread.ActiveSheet.DefaultStyle.Locked = false;
_gcSpread.ActiveSheet.Columns[0].Locked = true;
_gcSpread.InvalidateSheet();
|