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
Code:
' 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
usage: If not checkTextFile("myfile.txt") then .... do something