Is there a function that it can detect a file (eg. a exe or a txt file ) is running or opening .....
thx for your reply !!:o
Printable View
Is there a function that it can detect a file (eg. a exe or a txt file ) is running or opening .....
thx for your reply !!:o
Will you know the caption of the program you want to check?
IF it's a data file ( like a .txt) you can use the open command and check for errors on open. An error on open (if you know the file exists) means the file is open by something else
usage: If not checkTextFile("myfile.txt") then .... do somethingCode:' assume you know the file DOES exist
Function checkTextFile(str as String) as Boolean
On error goto is_open
Open strFile for append as #1
close #1
checkTextFile = False
Exit function
is_Open:
checkTextFile = True ' means the file IS open
End Function