In this tutorial I will share a VBA Function (User-Defined Function) that can detect whether if a file is currently opened.
VBA Script
In this tutorial I will share a VBA Function (User-Defined Function) that can detect whether if a file is currently opened.
Some how this function does not work on network mapped drive.
In our company we have shared drive (say, letter S is shared drive letter for colleagues to share files) and I found this function couldn’t detect opened file under S.
You need to fully qualify the path of your network. S:\ is a mask for the fully qualified path on the network for an example:
S:\[rest of your path goes here] would be the same \\Fwdsem_uwfile55\dpt$\UW\[rest of your path goes here]
To get your company’s full network path go to the window start menu, type CMD then hit enter, with the command window open type in NET USE, you will get a list of all Drive Names with their associated fully qualified network path. This path if the user has access is a path EVERYONE can use on the network, not just those with S:/ mapped to the network path needed.
If it’s network drive should also has address other like path “S:/” so try to find it out.
In my company we use \\xxxx and I use that in my code to save files/open them etc.
It worked very well on my system.
Thank you!!