Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to clear Excel session in Task Manager
Message
 
To
20/12/2000 19:54:18
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Miscellaneous
Thread ID:
00455720
Message ID:
00455749
Views:
29
>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
Previous
Reply
Map
View

Click here to load this message in the networking platform