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.app lication') ;
mywb:=myexcel.workbooks.op en(xlsfile );
Then how do I close/free the object?
Thanks!
EricTing
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.app
mywb:=myexcel.workbooks.op
Then how do I close/free the object?
Thanks!
EricTing
mywb:=Unnasigned;
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.