Dear Borissov,
Thanks for all the help. I do not know how I put in that fclose() at that point. I was experimenting with various permutations and combinations, and inadvertently sent in that piece of code to you. Feels stupid, all the same..!
But you were right about placement of the fclose()
I have presently adapted Cetins code, with your fclose() location suggestion, and got the right result. My final code is below:
lnHandle = fopen('c:\devstudio\panorama\PTYG.xls',12)
if m.lnHandle > 0
MESSAGEBOX("File is NOT open")
else
lInUse = .t.
MESSAGEBOX("File is open")
ENDIF
fclose(m.lnHandle)
With best regards,
Steve.