本帖最后由 Richard.Ma 于 2021-3-22 17:13 编辑
可以尝试一下以下代码,遍历设置locked为false以后,再将你需要的设置为true
- fpSpread1.OpenExcel(@"D:\Projects\0322.xlsx");
- fpSpread1.Sheets[0].Protect = true;
- fpSpread1.Sheets[0].LockBackColor = Color.LightCyan;
- foreach( Column c in fpSpread1.Sheets[0].Columns)
- {
- c.Locked = false;
- }
- fpSpread1.Sheets[0].Cells[1, 1, 1, 2].Locked = true;
复制代码
|