Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Errors with the UserStatus collection

Status
Not open for further replies.

Zenkai

Programmer
Dec 17, 2002
31
US
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?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top