Read/Write same Excel multiple times in a process

What are the best practices to follow if a BOT has to read and write same excel multiple times in a process? How can I make sure that only one instance is open at one time, close the file gracefully before using it next time? Any kill process needed? Please feel free to pour in your suggestion.
Thanks!

Hi,
If the data table format is the same then:
keep all the files in one folder using the directory.get files
once you get the path inside the for each you should loop all the files into the activity.
so you will get the data table after you read merge that data table and keep it one Variable.

lIke this, you can avoid using activity multiple times

@kaurM

-Wrap all your Excel-related activities, such as Read Range, Write Range, and other operations, inside an “Excel Application Scope” activity. This activity helps you work with Excel in a controlled manner.
-After you’ve finished working with an Excel file, make sure to use the “Close Workbook” activity to gracefully close the file. This helps to release any locks and resources associated with the file.
-Before opening the Excel file, you can use a “Try-Catch” block or a “Do While” loop to check if the Excel process is already running.

Cheers…!

1 Like

I prefer using Excel as a database, For basic read, write it is easy to use as a basic database, especially for small-scale data storage and retrieval. You can refer link for more info.

https://forum.uipath.com/t/using-excel-as-database/307033

Hi ,

For reading excel it is not an issue while writing please excel scope and activities for proper handling of excel operations