what i can do to close Excel ?
With the old TAutoOle : oExcel:End() it was ok.
Antonio told me : oExcel := NIL.
It is not working, because in the Filemanager
Excel is still visible and not closed.
Regards U.König

This is definitely not true. Please, show a sample to demonstrate the problem.Gale FORd wrote:I thought the same as you, but after helping someone with an Excel problem we found that Excel will still be running even though you cannot see it.
Running the task manager after doing the oExcel:quit() shows that Excel would still be resident until the variable was set to nil.
Code: Select all
FUNCTION MAIN()
LOCAL lRunTest := .t.
LOCAL oExcel, oSheet
clear screen
do while lRunTest
@ 10, 0 say 'Run Excel Test ' get lRunTest picture 'y'
read
if lastkey() = 27
exit
endif
if lRunTest
@ 20, 0
// This does not work
// even though you tell excel to quit it is still
// running until variable gets reset.
oExcel = CREATEOBJECT( "Excel.Application" )
oExcel:quit()
@ 20, 0 say 'Ok now check with Task Manager'
wait
// Works if you run in function that releases variable
// or you release variable yourself
oExcel := nil
TestExcel()
@ 20, 0 clear
@ 20, 0 say 'Ok now check Task Manager again'
endif
enddo
RETURN( nil )
FUNCTION TestExcel()
LOCAL oExcel, oSheet
oExcel = CREATEOBJECT( "Excel.Application" )
oExcel:quit()
RETURN( nil )