Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to kill excel.exe process
Message
From
20/01/2011 06:22:56
 
 
To
20/01/2011 05:08:00
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Miscellaneous
Thread ID:
01496645
Message ID:
01496651
Views:
102
In addition to Sergeys answer:

You won't be able to release the instance of Excel from memory if you have ANY reference to it. Look at this example
loExcel=Createobject('excel.application') && lcExcel is one reference to Excel in memory
loWB=loExcel.Workbooks.Open(lcFile) && loWB is another reference
loSheet= loWB.Sheets(lnSheet) && loSheet is a third reference
* Typically you have even more references. Now to remove Excel from memory, you must try to remove each reference IN REVERSE ORDER
* This means that you can't release a variable as long as another variable depends on it, so to say
loSheet=.null.
release loSheet
loWB=.null.
release loWB
loExcel=.null.
release loExcel && Now Excel is released from memory since also loSheet and loWB are released.
>Dear,
>
>I need to close the excel file even if attempt below code but does not close the excel process
>
>loExcel.quit
>loExcel=null
>
>this is happened when when I try to open xlsx file thru office 2003 platform ,needless to say I hv done convertion tools from xlsx to xls file
>fyi, it is opening thru normal excel operation but failed in vfp automation error msg "The server threw an exception".
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform