Shared FOLDER in Use

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.



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
</pre>
 

Excel Facts

Format cells as currency
Select range and press Ctrl+Shift+4 to format cells as currency. (Shift 4 is the $ sign).
Hi,

How about iterating trough all the files in the shared folder and checking if they are open via the same IsFileOpen Function ?

Regards.
 
Last edited:
Upvote 0

Forum statistics

Threads
1,215,731
Messages
6,126,539
Members
449,316
Latest member
sravya

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top