Skip error when using Use Excel File activy

Hello friend,
i would really appreciated if you could help me with this problem.
I want to program a series of instructions to be made for several excel files saved inside a network.

I want my bot to go through all differents excel files. So that, my robot must acces to those excel files. Sometimes those excel files are opened for other users and for that reason not available to be used for my robot.

The problem i want to resolve is:
I want my robot to skip error if a Excel file that is supossed to be used is not available (because is already opened , etc)and continue with the other excel file in line to be used.

the structure of my program is:

is there any parameter or method to make it happen?

Thanks in advance for any help and advise…
Ricchch

Hi @Ricchch ,

We would maybe have to use Try Catch Activity to handle or skip the errors on Each Excel file that you are trying to use.

Another Option would be to maybe configure Existing Processes Action property of the Excel Process Scope activity as Force Kill so that the Excel task would be killed and the automation should be able to continue.

Hope the below steps would help you resolve this

  1. I assume u have the list of excel filepaths in a array variable named arroffiles

  2. Now use a FOR EACH activity and pass array variable as input and change the type argument as string
    Or
    Better use for each file in a folder activity

  3. Inside the loop use a TRY CATCH activity and keep USE EXCEL file inside the try block and have all the reading activities
    If something goes wrong the exception will be caught in CATCH Block where use a KILL PROCESS activity with Processname property as “Excel”

  4. This will ensure that though excel fails it continues with next file without any issue

Cheers @Ricchch

1 Like

Step 1: Loop Through Excel Files Using For Each Loop
Step 2: Put try catch block into IT
Step 3: In try block put your Excel activities
Step 4: In catch block catch the error & also add continue statement so that it will continue with the loop.

Hope this will help.

1 Like

Thanks @supermanPunch ,
i tried with out succes,
Thanks anyway for helping

@Ricchch ,

Could you let us know more on the implementation tried or Screenshots of it so that we could suggest the correction or check with alternate methods.

Hello @Palaniyappan
thanks for helping.
Actually i neither write a list with the email’s paths nor i used Try catch…
But i will follow your suggestions .
i never used Try catch before but i will tried during weekend to built the program as you suggest…
Thanks a lot :handshake:

@supermanPunch
hello and thanks for helping.
actually , i have this error msg (traduction: the file .xlsm is read-only and can not be modified… )

here is a description of properties at Excel process scope activity…

Forcer arrĂŞt = Force Kill
fermer sans enregist… = Close without saving

and here a description fo my execute macro properties:

Thanks for helping

1 Like

Thanks @Palaniyappan

1 Like

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