用于了解工作簿是否受保护和共享的属性/方法 [英] Property/Method to know if a workbook is Protected and shared
问题描述
有一种方法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屋!