UserAccessList 集合的功能(VBA)
更新时间:2009年07月15日 20:18:13 作者:
可用 ProtectedRange 对象的 Users 属性返回一个 UserAccessList 集合。
(福利推荐:【腾讯云】服务器最新限时优惠活动,云服务器1核2G仅99元/年、2核4G仅768元/3年,立即抢购>>>:9i0i.cn/qcloud)
(福利推荐:你还在原价购买阿里云服务器?现在阿里云0.8折限时抢购活动来啦!4核8G企业云服务器仅2998元/3年,立即抢购>>>:9i0i.cn/aliyun)
返回一个 UserAccessList 集合后,便可用 Count 属性来确定访问受保护区域的用户数量。在下例中,Microsoft Excel 将访问第一个受保护区域的用户的数量通知给用户。本示例假定受保护的区域位于活动工作表上。
Sub UseDeleteAll()
Dim wksSheet As Worksheet
Set wksSheet = Application.ActiveSheet
' Notify the user the number of users that can access the protected range.
MsgBox wksSheet.Protection.AllowEditRanges(1).Users.Count
End Sub
复制代码 代码如下:
Sub UseDeleteAll()
Dim wksSheet As Worksheet
Set wksSheet = Application.ActiveSheet
' Notify the user the number of users that can access the protected range.
MsgBox wksSheet.Protection.AllowEditRanges(1).Users.Count
End Sub
相关文章
关于vba代码运行时错误1004?应用程序定义或对象定义错误问题
这篇文章主要介绍了vba代码运行时错误1004?应用程序定义或对象定义错误,经过一系列问题调查发现是工作表中数据存在异常,需要的朋友可以参考下2022-10-10
最新评论