如何使用开放XML将工作表设为只读 [英] How to make worksheet Readonly using open xml

查看:104
本文介绍了如何使用开放XML将工作表设为只读的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用包含两个选项卡的开放xml创建一个excel工作簿,我想将第二个选项卡设置为只读.有解决方案吗?

Creating one excel workbook using open xml which contains two tabs i want to make second tab as read only.Is any Solution?

推荐答案

; Excel充当数据的编辑者,因此,不存在纯粹的只读"数据.但是,存在诸如锁定"和验证之类的东西,这可以帮助减少至少意外的修改.这应该给你一个主意:
http://www.mrexcel.com/archive/Formatting/13013.html [ ^ ].

如果要以编程方式执行此操作,则仍然必须在Excel interop中找到适当的属性:
http://msdn.microsoft.com/zh-cn/library/microsoft.office.interop.excel%28v = office.11​​%29.aspx [ http://msdn.microsoft.com/en-us/library/ms173186%28v = vs.80%29.aspx [ ^ ].

—SA
If you think about it; Excel acts as an editor of data, among other things, so there is no such thing as pure "readonly" data. However, there is such thing as "locking" and also validation, which can help to reduce at least accidental modifications. This should give you the idea:
http://www.mrexcel.com/archive/Formatting/13013.html[^].

If you want to do it programmatically, you still have to find appropriate properties in Excel interop:
http://msdn.microsoft.com/en-us/library/microsoft.office.interop.excel%28v=office.11%29.aspx[^],
http://msdn.microsoft.com/en-us/library/ms173186%28v=vs.80%29.aspx[^].

—SA


这篇关于如何使用开放XML将工作表设为只读的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆