Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Close OLE processes

marcelom_bovo
Participant
0 Likes
2,336

Hi people,

I´m using OLE objects to manipulate Excel, but I´m having one problem,

Once I stop using the spreadsheet I use the method "QUIT" and then "FREE OBJECT" to kill the excel processes, BUT, the processes do not close.

After I used the program a few times, I look at the task manager and its full of excel processes.

I tried to use the "FREE OBJECT" in all OLE objects and in the application only, but none of this work out.

Someone can help me with that?

Thanks

1 ACCEPTED SOLUTION
Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
1,406

There may be something in your ABAP code in between when you open the file and when you close that file that is not right and hence causing a disconnect. If there is a disconnect, this is the reason why your excel program is left open. YOu need to make sure that every method that you are calling in between the open and close is being called correctly, and is sucessful. If one method call fails, it could cause a disconnect. I have seen this in the past.

Regards,

Rich Heilman

2 REPLIES 2
Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
1,407

There may be something in your ABAP code in between when you open the file and when you close that file that is not right and hence causing a disconnect. If there is a disconnect, this is the reason why your excel program is left open. YOu need to make sure that every method that you are calling in between the open and close is being called correctly, and is sucessful. If one method call fails, it could cause a disconnect. I have seen this in the past.

Regards,

Rich Heilman

Read only

RaymondGiuseppi
Active Contributor
0 Likes
1,406

Are you using steps like

CREATE OBJECT e_appl 'EXCEL.APPLICATION'.
SET PROPERTY OF e_appl 'VISIBLE' = 1.
CALL METHOD OF e_appl 'WORKBOOKS' = e_work.
CALL METHOD OF e_work 'Add' = e_work.
GET PROPERTY OF e_appl 'ActiveSheet' = e_activesheet.
SET PROPERTY OF e_activesheet 'Name' = <sheetname>.

" work witch cells

CALL METHOD OF e_work 'SAVEAS' EXPORTING #1 = <filename>.
CALL METHOD OF e_work 'close'. " maybe this one is missing
CALL METHOD OF e_appl 'QUIT'.
FREE OBJECT e_appl.

Regards