简体   繁体   English

Excel Interop - 保护表不包括列

[英]Excel Interop - Protect sheet excluding column

Hi I'd like to protect a worksheet excluding a column or a range of cells, any one have any idea's on how to accomplish this without resorting to going in manually after generation and unprotecting them? 嗨,我想保护一个不包括列或一系列单元格的工作表,任何人都知道如何实现这一点而不需要在生成后手动进入并取消保护它们?

Thanks ahead of time ^_^ 提前谢谢^ _ ^

The definition of whether a cell stays locked is present within the cells themselves, so you can at best define the ranges that aren't supposed to be locked after you generate the worksheet but before you protect it: 单元格是否保持锁定的定义存在于单元格本身中,因此在生成工作表之后但保护之前,最多可以定义不应该锁定的范围:

Worksheet wks = new Worksheet();
wks.Range["F:F"].Locked = false;
wks.Protect();

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM