Application Development 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: 

If download of OLE Excel is cancelled then Excel process is not terminated(it is still running in task manager)

Former Member
0 Kudos

Hello,

I have written an ABAP program, which creates and formats an excel sheet via OLE.

I have set visible to 0, as I do not want to see the operations on the excel.

At the end of the program, I am calling FILE_SAVE_DIALOG FM, so that I can specify a filepath to where the excel can be downloaded to.

Then I am calling method of sheet "SaveAs", and passing the above filepath.

Then I close, quit and free the objects.

It is working completely fine, the excel is downloaded and the task manager process is closed.

But in the FILE_SAVE_DIALOG pop up, if I click "CANCEL" button, the excel process still keeps running in the task manager. I close,quit,and free the objects regardless of whether the user chooses save or cancel.

So why is the process still running?

Thanks,

Kavya

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hello,

I think your problem is this: when you try to close the application after clicking CANCEL excel asks you if you really want to close without saving (you can't see it because you set visible to 0). If you want to close excel anyway you have to disable that dialog hiding the alerts, you can do as follow:


CREATE OBJECT excel 'EXCEL.APPLICATION'.

...

GET PROPERTY OF excel 'Application' = application.

SET PROPERTY OF application 'DisplayAlerts' = 0.

CALL METHOD OF application 'Quit'.

Regards,

Marco

2 REPLIES 2

Former Member
0 Kudos

Hello,

I think your problem is this: when you try to close the application after clicking CANCEL excel asks you if you really want to close without saving (you can't see it because you set visible to 0). If you want to close excel anyway you have to disable that dialog hiding the alerts, you can do as follow:


CREATE OBJECT excel 'EXCEL.APPLICATION'.

...

GET PROPERTY OF excel 'Application' = application.

SET PROPERTY OF application 'DisplayAlerts' = 0.

CALL METHOD OF application 'Quit'.

Regards,

Marco

0 Kudos

Thanks. It solved the problem.