用于了解工作簿是否受保护和共享的属性/方法 [英] Property/Method to know if a workbook is Protected and shared

查看:68
本文介绍了用于了解工作簿是否受保护和共享的属性/方法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有一种方法ProtectSharing可以保护和共享工作表,也可以使用unprotectSharing方法。

There is a method ProtectSharing to protect and share a worksheet, also the method is available for unprotectSharing.

但是给定一个工作簿我如何才能找到工作簿在工作簿上使用Excel对象模型apis保护和共享??

But given a workbook how do i find that the workbook has been protected and shared using Excel object model apis on workbook??

推荐答案

你真的不需要API。

You really don't need API's for this.

您可以使用.ProtectContents检查"保护"状态,使用.MultiUserEditing检查"共享"状态。状态。

示例:

如果Sheet1.ProtectContents = True则MsgBox"受保护的工作表"&b
如果Workbook1.MultiUserEditing = True则MsgBox" ;工作簿共享"

You can use .ProtectContents to check for the 'Protection' Status and .MultiUserEditing to check for "Shared" Status.
Example:
If Sheet1.ProtectContents = True Then MsgBox "Protected Sheet"
If Workbook1.MultiUserEditing = True Then MsgBox "Workbook is Shared"


这篇关于用于了解工作簿是否受保护和共享的属性/方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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