>>'Release' will only release the variable. It won't take XL out of memory, and it really isn't needed anyway if oleexcel is local. oleexcel.quit() is the way to go as Selim pointed out.
>
>also Selim is correct, and this is also the more correct way, realese oleexcel will terminate excel. try and watch the task manager:
>oleexcel = CREATEOBJECT("Excel.application")
>release oleexcel
>
>i would think that this would be equal to terminating the process in the task manager.
Gunnar,
With this simple 2 lines it might. However almost all the time when you have an execl object you do something with it like adding, opening a workbook. If you do then releasing doesn't remove excel instance :
oExcel = createobject('Excel.Application')
oExcel.Workbooks.Add
release oExcel
To my experience both a oExcel.quit and release of variable is required. Releasing the variable with code however might not be necessary. As routine ends variable goes out of scope implicitly (provided not public).
Interestingly (don't have demo code right now) sometimes it's necessary oExcel should be in scope till user really exists excel (sounds version based). This once hit me badly, my partner reporting a crash and I wasn't seeing it at all with same code. It turned out to be I was using menu to close a sheet and he was using 'Ctrl+F4' (VFP5 days - excel 97?).
Cetin