Move excel files into another folder

I need to move excel files from one folder to another. I have done this part, but am stuck in the second part where if a file is in use, then skip to another file, else the bot logs a message. How do i do it?

Hi @Username95, welcome to forum

Inside the loop try with try catch

In try section, add the sequence of moving file to folder
In catch section,
If exception occurs , then in catch section log a message and provide continue activity so that I can move to next file

Hope it helps

Mark it as solution if u got it :slightly_smiling_face:

Nived N :robot:

sorry i’m abit new. how to check if exception occurs?

Take this for reference for try catch

We are performing our normal work in try section, but if Exception is catched by catch section in try catch catch block
In our case if file is in use it will throw an exception, that Exception is catched by catch section , and do the required action if exception occurs, in our case moving to next file for that I have specified to use continue activity so that it continues to next file

Hope it helps
Mark it as solution if u got it

Nived N :robot:

so i should catch a system exception?

U should catch IOException
@Username95

Hope it helps

Note : use try catch inside the loop only

Mark it as solution if u got answer

Nived N

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