Problem close excel file with close application activity


I have a little problem when using the close application activity for a specific excel file.
When I have multiple excel files opened and not yet saved new content in some files (but not the file I want to close with the application), The close application activity gives an error, because it closes all my excel files even thought I uses a selector specific for the title of the excel file and thus because I did not save some files yet it cannot close my excel file and therefor not go further in the sequence and throw error …
How should I solved this kind of problems


You can use Close Workbook activity.



But how you can use close Workbook activity if you don’t work with the excel activities?
I only read the excel file once and than use Data table from this output. I just trying to fix some test cases for example when the excel file is still open when starting the UiRobot ?
in the close workbook activity you need to fill in the workbook variable, or can I put something else here? the full path?

Hi @Siene,

If you use the Excel Application Scope activity to open your Excel file, read range to data table from within the Scope activity, and then exit the Scope, it will close only that workbook automatically. It can even do it in the background if you set Visible to off.


Thank you for your answer but, I don’t want to use Excel Application Scope … everything must work in the background on a desktop …
I just wanted to be prepared for mistakes of users of the project. I wanted to put in a try catch when users did open the excel sheet not on purpose that it would close only this specific excel sheet en try to run the workflow again …