April 2006
Beginner
1114 pages
98h 16m
English
workbook.RemoveUser(Index)
For shared workbooks, disconnects a user from editing the workbook.
|
Argument |
Settings |
|---|---|
|
|
The index of the user to disconnect |
Use the UserStatus method to get an array containing the users editing a shared workbook. The following code allows you to disconnect users from a shared workbook:
If ThisWorkbook.MultiUserEditing Then
Dim usr( ), msg As String
usr = ThisWorkbook.UserStatus
For i = 1 To UBound(usr)
msg = "Disconnect user " & usr(i, 1) & "?"
If MsgBox(msg, vbYesNo) = vbYes Then _
ThisWorkbook.RemoveUser (i)
Next
End IfRead now
Unlock full access