Who has my workbook open?

  • Thread starter Thread starter Stephen sjw_ost
  • Start date Start date
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!
 
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
 
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top