I'm having trouble getting VBA to display the user names of individuals who have a workbook open for editing. I am using:
Sub GetUserName()
Dim users As Variant
Workbooks.Open ("T:\Book1.xls")
users = Workbooks("Book1.xls").UserStatus
If UBound(users, 1) > 0 Then
MsgBox users(1, 1) & " already has the book open."
End If
End Sub
And I receive the error "Cannot access the read-only file T:\Book1.xls"
What gives?
Sub GetUserName()
Dim users As Variant
Workbooks.Open ("T:\Book1.xls")
users = Workbooks("Book1.xls").UserStatus
If UBound(users, 1) > 0 Then
MsgBox users(1, 1) & " already has the book open."
End If
End Sub
And I receive the error "Cannot access the read-only file T:\Book1.xls"
What gives?