admin管理员组文章数量:1323716
I am trying to protect an excel sheet where the cells can be selected but not editable I have made the cells unlocked in the cell format but the selection is disabled once the Excel file is opened.
SheetProtection sheetProtection = new SheetProtection
{
SelectLockedCells = true, // Allow selection of locked cells
SelectUnlockedCells = true
Sheet = true, // Enable sheet protection
Objects = true, // Protect objects (like charts)
Scenarios = true, // Protect scenarios
FormatCells = false, // Prevent formatting of locked cells
FormatColumns = false, // Prevent formatting columns
FormatRows = false, // Prevent formatting rows
};
sheetPart.Worksheet.InsertAfter(sheetProtection, sheetData);
In the XML file it is reflected the sheet protection and select unlocked and locked cells are true.
<x:sheetProtection sheet="1" objects="1" scenarios="1" formatCells="0" formatColumns="0" formatRows="0" selectLockedCells="1" selectUnlockedCells="1" />
expectation is the excel sheet were the cells can selectable, so the unlocked cells can be edited.
本文标签:
版权声明:本文标题:.net - select unlocked cell and selecrt locked cell is not working on the sheetprotection in openXML, C# - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1737296796a1972246.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论