Not sure if this is what you're looking for or not, but I always have the process check for a lock file before opening Word documents, Excel workbooks, etc. Just as you mentioned there is a second file with the same name but begins with ~$.
I usually first do File Exists for the [Folder Path] & [File name]
...followed by a decision stage to determine whether to throw an error if the file does not exist.
...followed by File Exists again but this time for [Folder Path] & "~$" & [File name]
...followed by a decision stage to determine whether to throw an error if the lock file exists, indicating that someone else has the file open. This may not be perfect, but it has never failed for me.
Â
The other option (which I have not attempted because I don't prefer it) is to create a copy of the file before opening it. You'd check to see if the file is there and then check to see if there is a lock file for it as well. If there is a lock file, then you copy the file into the same folder with a new name. Then open the new file, get the data, and do whatever you need to. Then either archive or delete the new file afterward. The problem with this method is that it doesn't work if you need to write data inside the file. It would really only be useful if you're only reading from the file.
Dave Morris, 3Ci at Southern Company