Excel application scope not able to read excel files that are already opened

Hi, I have a scenario where multiple bots will read the same file may be at the same time.
As Excel application scope can be used to read files that are already opened I used it.
However it is giving error as ‘file is already used by another process’ - this exception we expect in workbook and not in application scope.

Help would be appreciated.

@RK_S

you can implement a loop so that if this error is there…then run loop again to read with delay so that the first one which opened will complete and the next picks it

cheers

you can implement retry logic in your workflow to retry reading the file if it is locked by another process. You can catch the “file is already used by another process” exception and retry reading the file after a short delay.

update I have implemented another more robust logic to the solutions provided, thanks

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