且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何在受保护的工作表上默认创建不受保护的单元格?

更新时间:2023-02-18 21:04:10

无法创建默认解锁的单元格;锁定是默认值.但是您通过创建一个 CellStyle 并将锁定设置为 false 是在正确的轨道上.确保将所有要解锁的新 CellStyle 对象上的锁定设置为 false.此外,Excel 对可以在 Workbook 中创建的单元格样式数量有限制,因此对每个 Cell 重复使用您的 CellStyle 对象 你创建.

It is not possible to have created cells default to unlocked; locked is the default. But you are on the right track by creating a CellStyle with locked set to false. Make sure that you set locked to false on any and all of your new CellStyle objects that you want to be unlocked. Additionally, Excel has a limit on the number of cell styles that can be created in a Workbook, so re-use your CellStyle object(s) with each Cell you create.