Read, Write, and Append Data in Excel
The example below explains how to copy ranges from a workbook, paste, and append them to another workbook. It presents activities such as Read Range Workbook, Write Range Workbook, and Append Range Workbook. You can find these activities in the UiPath.Excel.Activities package.
Download and extract the archive with the project in this example and copy the two .xlsx files to your project folder.
This is how the automation process can be built:
-
Open Studio and create a new Process.
-
Drag a Sequence container in the Workflow Designer.
- Create the following variable:
Variable Name Variable Type Default Value employeesDataTable N/A -
Add a Read Range activity inside the Sequence container.
- Add the expression
"companyEmployees.xlsx"in the Workbook path field. - Add the value QADep in the Sheet field and set the cells range at "A1:B5".
- Add the expression
-
Add a Write Range activity below the Read Range activity.
- Add the expression
"employeeIncome.xlsx"in the Workbook path field. - Add the value
"DecemberIncome"in the Sheet field and set the cells range at "A2". - Add the variable
employeesin the Data Table field.
- Add the expression
-
Add a Read Range activity below the Write Range activity.
- Add the expression
"companyEmployees.xlsx"in the Workbook path field. - Add the value DevDep in the Sheet field and set the cells range at "A6:B10".
- Add the expression
-
Add an Append Range activity below the Read Range activity.
- Add the expression
"employeeIncome.xlsx"in the Workbook path field. - Add the value
"DecemberIncome"in the Sheet field. - Add the variable
employeesin the Data Table field.
- Add the expression
This is how the workflow should look:

- Run the process. The activities copy data from one workbook and add it into a second workbook.