Thanks for that tip, it now works only if it does not get caught up in an error. exp. sheet = APR it doesn't clear memory any suggestions?
loexcel=CREATEOBJECT("Excel.application")
loexcel.workbooks.open(txtfile,,,,passwrd)
* Error catching - Turn off FoxPro's error trapping
err=.f.
ON ERROR err=.t.
loExcel.Sheets("JAN").Select
IF !err
lcquarter=1
else
err=.f.
loExcel.Sheets("APR").Select
IF !err
lcquarter=2
endif
ENDIF
loexcel.ActiveWorkbook.Close **here I'm getting an error as if this object does not exsist
loexcel.Application.Quit **here I'm getting an error as if this object does not exsist
loexcel=.NULL.
RELEASE loexcel
on error