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.
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 )
Return to FiveWin for Harbour/xHarbour
Users browsing this forum: No registered users and 73 guests