I am working on activity Get Table Range Workbook

I am new to UI path and learning to automate excel for activity ‘Get Table Range Workbook’ . I have an excel with Data as displayed below

Step 1: Use Excel File activity and give excel path having data
Step 2: Inside Do Add activity “Get Table Range Workbook” with excel name and sheet1
Step 3: Add Message Box

When I run and executes step 1 the excel opens up and goes to step 2 and I get a red box with output message
Get Table Range Workbook: The process cannot access the file ‘C:\Excel \Sample.xlsx’ because it is being used by another process.
Note : All excel instance are closed before running the code.

Hello @sobin_paul Actually the Use excel file open the excels and the if you’re using workbook activity then it’ll throw the error because it can’t access the excel which is open so use Excel activity like read range activity to read the table or the datat which you want to read in datatable variable as dtData and then Message Box with "Rows count: " + dtData.Rows.Count.ToString it’ll show the row count.

Also may i know which verfsion of excel package you’re using?

Cheers

hi, @sobin_paul use excel classic activities or excel modern activities for read and write dont mix both.

Hello @sobin_paul,

you want to use ‘Get Table Range Workbook’, then don’t use ‘Use Excel File’ — just give the file path directly.

@sobin_paul,

Read the Table range using Modern activities like this.

This error usually occurs when the Excel file is already being accessed by another process, even if it’s not visibly open. Try a few quick fixes:

  1. Make sure no hidden Excel instances are running — check Task Manager and close any Excel processes.
  2. Use the Use Excel File activity in “Read” mode if you only need to fetch data, not modify it.
  3. If the file is stored in a shared or synced folder (like OneDrive or Google Drive), pause syncing temporarily while running the automation.
  4. You can also add a small delay (1–2 seconds) before the “Get Table Range Workbook” activity to ensure the file is fully released by the system.

After trying these steps, run your workflow again — it should work fine.

@sobin_paul

There are two types of excel activites

  1. Which are to be used inside excel scope called excel activities
  2. Workbook activities which are used directly without scope

Youcannot use 2 inside 1.so you can remove scope so that the error goes off and data is read

Cheers

1 Like