如何使用特定的共享工作簿获取用户列表? [英] How can I get list of users using specific shared workbook?
问题描述
我正在使用共享的工作簿。有一个代码可以撤销WB的共享,更新工作表中的数据,然后再次共享WB。
如果有用户连接到这个WB,他们将失去保存在WB上的能力,并且excel将要求他们以不同的名称保存WB。
I'm using shared workbook. There is a code that undo share for the WB, updates data in the sheets and then share the WB again. If there are users connected to this WB, they will loose the ability to save on the WB and excel will ask the them to save the WB in different name.
我的问题是如何获取当前使用WB的用户列表?
My question is how can I get the list of the users that are currently using the WB?
这样我可以设置一个msgbox,用户使用
This way I can set a msgbox that alert upon there are users using the WB and keep the WB shared for all.
谢谢
推荐答案
Sub getListUsingUsers()
Users = ActiveWorkbook.UserStatus
MsgBox "Total Users using the current WorkBook: " & UBound(Users)
End Sub
此代码给我的用户数量的msgbox连接到WB。
This code give me the msgbox with the amount of users connected to the WB.
感谢@duDE
这篇关于如何使用特定的共享工作簿获取用户列表?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!