DesMoinesElvis
Programmer
Hello,
I have browsed through Tek-Tips using "Check if File Open" in VB 5&6 Forum as well as extensive searching out on the web for find an answer to my challenge.
In my VB program, I need to first check to see if a COBOL program is done writing data to a file before I go and list the file as ready to use in my app.
thread222-1437198 has a code snippet I tried to use which did not work.
The way I am testing is to open up a simple .TXT file with Notepad, leave it open, then I run my VB program which will search for the file name in a directory and if present list it. I need to further filter to see if the file is open before I throw it as an option in a list box.
Using the code snippets found in the above mentioned thread and other similar snippets on the web, the file opens in my VB app as if it were not already open by Notepad.
Does anyone know how to code in VB to check for a file being already opened by a non-VB program (such as Notepad or a COBOL program)?
Thanks.
Dave
I have browsed through Tek-Tips using "Check if File Open" in VB 5&6 Forum as well as extensive searching out on the web for find an answer to my challenge.
In my VB program, I need to first check to see if a COBOL program is done writing data to a file before I go and list the file as ready to use in my app.
thread222-1437198 has a code snippet I tried to use which did not work.
The way I am testing is to open up a simple .TXT file with Notepad, leave it open, then I run my VB program which will search for the file name in a directory and if present list it. I need to further filter to see if the file is open before I throw it as an option in a list box.
Using the code snippets found in the above mentioned thread and other similar snippets on the web, the file opens in my VB app as if it were not already open by Notepad.
Does anyone know how to code in VB to check for a file being already opened by a non-VB program (such as Notepad or a COBOL program)?
Thanks.
Dave