You can use any of the file routines VBA provides, or you can use the FileSystem object...
Basically attempt to open the text file and trap for errors. If there is an error, then the file is locked.
That's simplistic, I know, but it's basically what you have to do.