How to close an Excel file that is already open

My automation downloads an Excel file from SAP Gui. However it is stuck as the Excel that is downloaded automatically opens after it is downloaded. I have tried to use Use Application Browser to close the open Excel but it doesn’t work.
This is the activity:



Please let me know if there is any mistakes. Or can you advise me of any other methods to close the Excel.
Thank you.

Hi RobinsonFrancis,
Attached below you can find the .xaml file with the solution
Main.xaml (11.3 KB)

Cheers!

Hi @RobinsonFrancis

After downloaded and opened the Excel give some delay and use Kill Process activity or Close application activity to the kill the Excel application. In the process name field of kill process activity give EXCEL.exe it will close the Excel simply.

Or

If any case you are doing it in Studio X then use the use application and indicate the Excel then use click activity and indicate on close button to close the Excel.

Hope it helps!!

Setting it to “close = always” and sending the ALT+F4 is redundant. Take out the keyboard command and just let the “close = always” do its thing.

1 Like

This isn’t a very good recommendation as this can leave files corrupted, auto backups engaged (changing how Excel opens next time), interfere with other Excel windows that need to be open, etc.

It’s better to properly attach to, and close, the window

Hi @RobinsonFrancis

Try Kill Process Activity with ProcessName Excel

image

Hope it will helps you :slight_smile:
Cheers!!

@RobinsonFrancis

Use a close application activity inside use application/broswer or select close as always…or click on close button any of these would work

alternately kill process can be done but above are recommended first

cheers

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.