如何使用特定的共享工作簿获取用户列表? [英] How can I get list of users using specific shared workbook?

查看:120
本文介绍了如何使用特定的共享工作簿获取用户列表?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用共享的工作簿。有一个代码可以撤销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屋!

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