Hello everyone,
I have folders and subfolders that contains different files: pdf, autocads etc.. Before I move one folder, I need to make sure that all the files in the folders are closed, and to know who is the user that hasn't closed his files. Would you have any suggestion please?
Many thanks in advance.
Etxe.
i doubt you can do this with code, and even if you could it would be very difficult. macros certainly can't do it. you're talking about other files outside of office files, which is why the answer is probably no. it's more of a windows question than access i believe.
Hello everyone,
I have folders and subfolders that contains different files: pdf, autocads etc.. Before I move one folder, I need to make sure that all the files in the folders are closed, and to know who is the user that hasn't closed his files. Would you have any suggestion please?
Many thanks in advance.
Etxe.
Hello everyone,
I have folders and subfolders that contains different files: pdf, autocads etc.. Before I move one folder, I need to make sure that all the files in the folders are closed, and to know who is the user that hasn't closed his files. Would you have any suggestion please?
Many thanks in advance.
Etxe.
The title says "the file" which points to a specific file, but your explanation says: "I need to make sure that all the files in the folders are closed"
I go for the hard (second) one:
when you say different users opening the same files, I think you are on a windows network with a server for file sharing.
If this is the case you can do it in vba and possibly with macros. This is the vba method. you can convert it to macro:
Preparation:
Open notepad
Add the following lines and save it anywhere you want (I chose D:\OpenFiles.txt).
openfiles /Query /s Server /fo csv
pause
Change the Sever to your Server name.
Change the extension of the file to cmd. Now you have D:\OpenFiles.cmd
Usage:
Now in vba if you run the following code, you'll receive a list of all opened files along with their ID/machine names/users who are using shared files
Code:
Dim ret
ret = Shell("D:\OpenFiles.cmd", vbNormalFocus)
Now using the ID of the file, you can even close the files with the same method.
Notes:
Your account should be a member of admin group or find a way to run the cmd file with admin privilege.
If you are on a windows domain, you can even open computer management on your server, and go to system tools/Shared folders/open files, add a console form there to a shared folder. Copy/move it to your PC and run it. You can view a list of all opened files. You can even close one or all of them with a simple click
Now the other side of this. Sun_Force's solution works if you have admin rights, but MIGHT also work if you have full permissions on the files and the specific folder that is of interest to you. Ever since the advent of Windows NT a couple of decades ago, Microsoft has been trying to lock down security issues due to the previously wide-open nature of Windows. Seeing what other people are doing requires you to have EITHER admin privilege in general, or ownership permissions on the folder and files in question. And I won't guarantee that ownership will always do it if you are talking about network-level access.
Some utilities give you hints, like the .LDB file from Access or the $Filename file from Excel. But in general, only Windows can tell you, and it is generally disinclined to do so unless you are the boss. It's just a fact of life that Windows isn't as forthcoming as it used to be.
The title says "the file" which points to a specific file, but your explanation says: "I need to make sure that all the files in the folders are closed"
I go for the hard (second) one:
when you say different users opening the same files, I think you are on a windows network with a server for file sharing.
If this is the case you can do it in vba and possibly with macros. This is the vba method. you can convert it to macro:
Preparation:
Open notepad
Add the following lines and save it anywhere you want (I chose D:\OpenFiles.txt).
openfiles /Query /s Server /fo csv
pause
Change the Sever to your Server name.
Change the extension of the file to cmd. Now you have D:\OpenFiles.cmd
Usage:
Now in vba if you run the following code, you'll receive a list of all opened files along with their ID/machine names/users who are using shared files
Code:
Dim ret
ret = Shell("D:\OpenFiles.cmd", vbNormalFocus)
Now using the ID of the file, you can even close the files with the same method.
Notes:
Your account should be a member of admin group or find a way to run the cmd file with admin privilege.
If you are on a windows domain, you can even open computer management on your server, and go to system tools/Shared folders/open files, add a console form there to a shared folder. Copy/move it to your PC and run it. You can view a list of all opened files. You can even close one or all of them with a simple click
It looks promising: as I don't have access to the server for a couple of weeks, I 'd like to run a few trials in my local computer.
How should I adapt the following code please?
Many thanks!
i doubt you can do this with code, and even if you could it would be very difficult. macros certainly can't do it. you're talking about other files outside of office files, which is why the answer is probably no. it's more of a windows question than access i believe.