Read range error used by another process

Why does Read Range fail with file being used by another process in REFramework even though config.xlsx is not open ??

Hi @Aarya_singh

Goto task manager and kill excel then start the bot again.

Issue will be resolved

Thanks for the suggestion @Maheep_Tiwari, So while killing excel helps temporarily, it doesnt fully address the root cause

Hi @Aarya_singh

Check the root cause

This usually happens because an Excel.exe process is still running in the background, even though the file is not visibly open. REFramework reads Config.xlsx at startup, and if a previous run crashed or didn’t close Excel properly, the file stays locked. The fix is to ensure Excel is properly closed using Kill Process (Excel) before Read Range, or manually end Excel.exe from Task Manager.

1 Like

Hi @Aarya_singh ,

This issue should not occur frequently. It may occur if an Excel session is not closed properly or if the file is temporarily locked by another application such as an antivirus.

As a solution, place Kill Process (EXCEL) and Read Range inside the Action block of a Retry Scope, and add a short delay before executing the Read Range.

Hi @Aarya_singh

Please close all the excel and before reading just make sure to use kill activity before that hope it works

Thanks

This simply means excel instance is left open in the background.

As a good practice, in kill all application xaml, kill all excel instances ( Kill Process (EXCEL)) and then process. Also make sure when you are opening excel in process, close it once work is completed.

As a good practice, use read range inside a retry scope with a small delay.

As a best practice, when using Workbook activities, it is recommended to ensure that all related Excel instances are closed before the automation starts. Proactively closing any open Excel files helps prevent file-locking conflicts and ensures stable and error-free execution of Workbook activities.

Hi @Aarya_singh ,

The File is being locked by the automation itself, not by a lefover excel process. when multiple test cases or scope access config.xlsx at the same time, the file remains locked.

Ensure only one test reads config.xlsx at a time, close excel process scopes correclty or you can switch to workbook read range then avoid running multiple reframeworkk test cases in parallel

1 Like

I recommend adding the kill process activity in initallsettings.xaml to avoid this issue.

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