Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to kill excel.exe process
Message
De
20/01/2011 06:22:56
 
 
À
20/01/2011 05:08:00
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Divers
Thread ID:
01496645
Message ID:
01496651
Vues:
103
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".
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform