Hello,
I have an automation that generates a CSV file. In some cases, the generated CSV file may already be opened in Excel together with other Excel files.
I only want to force close the specific generated CSV file without affecting the other opened Excel files. Using the Kill Process activity is not an option because it closes all active Excel files.
Is there a way to close only the specific Excel/CSV file that is being used by the automation?
Thank you.
Hi @chavezneilb ,
Please find the attached threads for your reference
Dear Expert
I have opened Excel A, Excel B and Excel C
When process goes by, I need to close Excel A first
But I don’t want to use [Kill Process] cause it will close all Excel files
May I know if there is any other way to do so?
[image]
Thanks
Ivan
I have tested the workflow and and its closing only the workbook we needed to close,
[image]
[image]
[image]
It you cant find the input for close workbook activty then you dont have to create a variable and assign it.
Hi ,
i have 5 different excel files are open and i want to close a particular file during my bot running.
How can i achieve that ?
Thanks
Hope it helps!!
Hey @chavezneilb ,
Please use the “Close Workbook” activity instead of the “Kill Process” method. Here are the steps to follow:
Use the “Excel Application Scope” activity.
Inside the scope, add the “Close Workbook” activity.
Specify the file path of your CSV file.
If needed, check the “Save” option.
This will close only the specified workbook, leaving Excel itself open.
Hi @chavezneilb
please try this below approach:
If the CSV is opened through the automation, use:
Use Excel File / Excel Application Scope
2 Then use Close Workbook activity for that specific file.
If the file is already opened manually, you can:
1 Use Get Workbook/Window
2 Identify the workbook by file name
3 Close only that workbook instead of killing EXCEL.EXE
If Solution works for you please mark as Solution & Happy Automation with UiPath
Thanks
Nishi