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

Copy formula down without changing references
If you have =SUM(F2:F49) in F50; type Alt+' in F51 to copy =SUM(F2:F49) to F51, leaving the formula in edit mode. Change SUM to COUNT.

Jaafar Tribak

Well-known Member
Joined
Dec 5, 2002
Messages
8,611
Office Version
  1. 2016
Platform
  1. Windows
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:
Master Excel Bundle

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

Forum statistics

Threads
1,164,553
Messages
5,838,075
Members
430,527
Latest member
MyFace2

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
Top