How to close different excel file?

hi, this is my workflow. How can i close the excel file when i type into? everytime i will type into different excel file. How can i close the different excel file. The error message in close workshop is : Compiler error(s) encounted processing expression “fileName”.Value of type 'Uipath.Core.GenericValue’cannot be converted to ‘UiPath.Excel.Workbook.application’.

1 Like

Hi @jiejie,

For close workbook activity you have given filename, but it should be workbook of excel which you are using, so you cannot provide filename, you have to provide the output of either excel application scope if you are using that.

You can use kill process

i dont have use excel application scope

Use Kill process and use process name as “Excel”


@anil5 cannot close the excel file also


Are you providing Excel in process name or in process property , can you share the screenshot


1 Like

Put excel in double quotes “Excel”

1 Like


If you want to kill the process by specific filename, then refer the below workflow.

Pass the filename dynamically wherever the filename is there

kill EXCEL application sub-processes via specific name.xaml (8.9 KB)

@anil5 thank you so much. it work and close my excel file. but my excel file become like this 02 first one 05499900 after i put kill process. if i remove kill process, it will be the excel file. Can u help me to solve?

Hi @jiejie,

So is this happening for every excel file, and you are using which method i mean are you specifying process name property or process property.

Because for me it closes properly and doesn’t have that error.

Can you provide screenshot about how you are using kill process in your workflow.

001 002 003 004 005 006 007 008 009 10 11 012 013 14 15 16 17 18 19

This is my workflow. If i dont use kill process. It file name will be the file name i input. But if i put kill process file name change to the file as i said before. Then, everytime i will open the different excel file, then i will close my different excel file.

Open a Excel file and use kill process, and see if it’s killing the excel and changing the file name, if it’s working it should work in your code also

i am not able to open your code