Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to clear Excel session in Task Manager
Message
 
À
20/12/2000 19:54:18
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Divers
Thread ID:
00455720
Message ID:
00455749
Vues:
30
>Hi, when we use oxls=getobject("myexcel.xls") in vfp program to do some automation work, we use oxls =0 or relase oxls command to clear ole connection. However, the task manager in NT computer always open EXCEL.EXE session. It will cause some problem when we try to open an excel file later in a directory which contains many excel files.
>Can some one help me? Thanks.
* Another method to open Excel with a worksheet
oExcel.getobject(,'Excel.Application')
oExcel.WorkBook.Open("myexcel.xls")

* Maybe you know about this to prevent more than one instance:
oldOnError=on('error')
on Error oExcel=.NULL.
oExcel=getobject(,'Excel.Application')
on error &oldOnError
if isnull(oExcel)
   oExcel=createobject('Excel.Application')
endif
Also:
SetDisplayAlerts=.f.
* To end it
Release oExcel
If there is just one copy in taskman, it aint too bad. Some times its takes the com a while to disconnect.
Imagination is more important than knowledge
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform