【问题标题】:make Excel cells read-only using EPPLUS使用 EPPLUS 将 Excel 单元格设为只读
【发布时间】:2017-01-12 19:05:28
【问题描述】:

我有以下 excel 数据 其中我想将第一列和标题行设为只读。

CityMaster        POC       HeadCount
Mumbai          Prasad S       2
Delhi           Kishan T       5
Banglore        Shilpa S       7
Chennai         Prasad S       2

第二个和第三个数据应该是可编辑的。

【问题讨论】:

标签: c# asp.net-mvc excel epplus


【解决方案1】:

我试过了,效果很好:

workSheet.Protection.IsProtected = true;

workSheet.Cells[2, 3, pocDeatils.CityMaster.Rows.Count + 1, 4].Style.Locked = false;

更多详情请参考以下链接: https://epplus.codeplex.com/SourceControl/latest#SampleApp/Sample6.cs

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2012-08-22
    • 2012-10-19
    • 2023-04-08
    • 2016-07-15
    • 2017-09-22
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多