Not to prolong this... but it gets better: by actually using the Filename= and enclosing in quotes, when the file is locked, I now get the pop-up "File In Use", but cannot detect it from code.
#DefineSubRoutine chkoutxl()
retval=0
oXL = CreateObject("Excel.Application")
If oXL == 0 Then Terminate(@TRUE,"Cannot Continue","Cannot Initiate Instance of Excel.")
If oXL.Workbooks.CanCheckOut(::Filename="%cXLS%")<>@FALSE Then retval=1
If ! retval
oXL=0
Display(3,"Error","Cannot Check Out":@CRLF:cXLS)
Endif
Return(retval)
#EndSubRoutine
IntControl(73,2,0,0,0)
cINI=DirScript():"chkout.ini" ;just holds the URL
If ! FileExist(cINI) Then Terminate(@TRUE,"Cannot Continue","Missing Config Settings File ":cINI)
cXLS=IniReadPvt("Main","xls","",cINI) ;reads in URL
If chkoutxl()
BoxOpen("Please Wair...","Accessing ":cXLS)
oXL.Visible = 1
oXL.ScreenUpdating = 1
oXL.UserControl = 1
oXL.DisplayAlerts = 0
;error will be supressed and file will open to allow edit
;otherwise will open ReadOnly if already opened to allow edit
oXL.Workbooks.CheckOut(::FileName="%cXLS%")
oXL.Workbooks.Open(::FileName="%cXLS%",Readonly=@FALSE)
;however, if file is opened readonly this code WILL NOT execute
If oXL.ActiveWorkBook.ReadOnly
Display(3,"Cannot Continue",cXLS:@CRLF:"is opened ReadOnly.")
Endif
oXL=0
Endif
Exit
:WBERRORHANDLER
IntControl(73,1,0,0,0)
Return