Link to home
Start Free TrialLog in
Avatar of ericting
ericting

asked on

How to close Excel automation object

Hi Experts,
I use D7 to write an application to read a Excel file and extract some content and insert into SQL database. Everything is fine but I don't know how to end the Excel in the application. I examine with task manager and find several 'EXCEL.EXE'.

I use the follow statement to create the oleobject
 
  if opendialog.Execute then begin
       xlsfile :=opendialog.FileName;
       myexcel := createoleobject('excel.application');
       mywb:=myexcel.workbooks.open(xlsfile);


Then how do I close/free the object?

Thanks!
EricTing
Avatar of BlackTigerX
BlackTigerX

mywb:=Unnasigned;
ASKER CERTIFIED SOLUTION
Avatar of sas13
sas13
Flag of Russian Federation image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial