Who has my workbook open?

S

Stephen sjw_ost

Is there a way to find out who has an excel workbook open? I know this can be
done with Access. Can it also be done with Excel?
workstation, username, environ name, etc. Any one of these would be
acceptable.

Thanks for any help!
 
J

JLatham

As a matter of fact, here's the change to the one routine that would allow
you to browse for a file and determine if it is open, and if it is, by whom.
Of course you still need the rest of the code on that website.

Sub TestVBA()
'// browse for file
Dim strFileToOpen As String
strFileToOpen = Application.GetOpenFilename()
If Trim(UCase(strFileToOpen)) = "FALSE" Then
Exit Sub ' user cancelled
End If
If IsFileOpen(strFileToOpen) Then
MsgBox strFileToOpen & " is already Open" & _
vbCrLf & "By " & LastUser(strFileToOpen), _
vbInformation, "File in Use"
Else
MsgBox strFileToOpen & " is not open", vbInformation
End If
End Sub
 
S

Stephen sjw_ost

This is perfect! Thank you!
--
Stephen


JLatham said:
As a matter of fact, here's the change to the one routine that would allow
you to browse for a file and determine if it is open, and if it is, by whom.
Of course you still need the rest of the code on that website.

Sub TestVBA()
'// browse for file
Dim strFileToOpen As String
strFileToOpen = Application.GetOpenFilename()
If Trim(UCase(strFileToOpen)) = "FALSE" Then
Exit Sub ' user cancelled
End If
If IsFileOpen(strFileToOpen) Then
MsgBox strFileToOpen & " is already Open" & _
vbCrLf & "By " & LastUser(strFileToOpen), _
vbInformation, "File in Use"
Else
MsgBox strFileToOpen & " is not open", vbInformation
End If
End Sub
 
Top