Private Sub UsersList()
Dim users, msg As String, status As String
users = ThisWorkbook.UserStatus
For Row = 1 To UBound(users, 1)
msg = msg & users(Row, 1) & " " & Format(users(Row, 2), "dd/mm/yy h:mm")
& " "
If users(Row, 3) = 1 Then status = "(Exclusive mode)" Else status =
"(Shared mode)"
msg = msg & status & vbLf
Next
MsgBox msg, 64
End Sub
Michel ... UserStatus property is the good one but unfortunately is not useful if you have to open the file as read-only. So back to square one: if you want to trap an error (e.g. trying to save a file that is already open by someone else) you have to use something else and I don't know what to do
----- Michel Pierron wrote: ----
Hi Gabriel
Private Sub UsersList(
Dim users, msg As String, status As Strin
users = ThisWorkbook.UserStatu
For Row = 1 To UBound(users, 1
msg = msg & users(Row, 1) & " " & Format(users(Row, 2), "dd/mm/yy h:mm"
& "
If users(Row, 3) = 1 Then status = "(Exclusive mode)" Else status
"(Shared mode)
msg = msg & status & vbL
Nex
MsgBox msg, 6
End Su