samuel.nunn
New Member
- Joined
- Feb 22, 2009
- Messages
- 20
I have seen some macros that can tell you if a shared FILE is in use by another user, but is there a way for the macro to tell me if a ANY file on a shared folder is in use. I don't really need to know the name of the file, just that SOME file on that folder is in use.
Here is the code for a shared FILE (as given by Microsoft). I just need it for a FOLDER.
</pre>
Here is the code for a shared FILE (as given by Microsoft). I just need it for a FOLDER.
Code:
Sub TestFileOpened()
' Test to see if the file is open.
If IsFileOpen("c:\Book2.xls") Then
' Display a message stating the file in use.
MsgBox "File already in use!"
'
' Add code here to handle case where file is open by another
' user.
'
Else
' Display a message stating the file is not in use.
MsgBox "File not in use!"
' Open the file in Microsoft Excel.
Workbooks.Open "c:\Book2.xls"
'
' Add code here to handle case where file is NOT open by
' another user.
'
End If
End Sub