How To Obtain The Currency Cell Values Using UiPath.Excel.Activities?

How to get the Currency cell values using UiPath.Excel.Activities?

For this requirement follow the below tutorial:

  1. Assume that an EmployeeSalaries.xlsx file is created with data as below (the rows from the column E are Currency types)

1.png

  1. In Studio create a new Process and using the Manage Packages ribbon add the bellow Dependencies
  • UiPath.Excel.Activities[2.11.3]
  • UiPath.Mail.Activities[1.10.5]
  • UiPath.System.Activities[21.4.1]
  • UiPath.UIAutomation.Activities[21.4.4]

1.png

  1. Add a new Sequence (for example ReadCurrencyColumns)

2.png

  1. Add an Excel Process Scope activity

3.png

  1. Inside the Excel Process Scope activity add an Use Excel File activity

4.png

  1. Configure the Use Excel File activity as below

5.png

Excel file: "EmployeeSalaries.xlsx"
Read formating: (null)
Save changes: checked

  1. Add inside Do sequence a new For Each Excel Row activity

6.png

  1. Configure the For Each Excel Row activity as below

7.png

For each: CurrentRow
In range: EmployeeSalariesExcel.Sheet("Sheet1")
Has headers: checked

  1. Add inside Do sequence a new Read Cell Value activity

8.png

  1. Configure the Read Cell Value activity as below

9.png

Cell: CurrentRow.ByField("Salary/month")
Save to: Salary (for this create a new variable using Ctrl + K)
Get formatted text: checked

  1. Add a new Write Line activity

10.png

  1. Inside of Write Line activity, add for the Text section the variable Salary

11.png

  1. On running the project, the results will be like below

12.png

  1. To get the whole data of the Sheet page, add a new Read Range activity

13.png

  1. Configure the Read Range activity as below

14.png

Range: EmployeeSalariesExcel.Sheet("Sheet1")

Has headers: checked

Read formatting: (null)

Save to: dt_EmployeeSalariesValue (for this create a new variable using Ctrl + K)

  1. Add a new Output Data Table activity

15.png

  1. Configure the Output Data Table activity as below

16.png

DataTable: dt_EmployeeSalariesValue

Text: EmployeeTextData (for this create a new variable using Ctrl + K)

  1. Add a new Write Line activity and for Text add EmployeeTextData as seen in the above image

  1. On running the project, the results will be like below

17.png

Note: The project will have these variables created

18.png

  1. For example to get the "A4" cell value, use the Read Cell Value activity as below

19.png

Cell: EmployeeSalariesExcel.Sheet("Sheet1").Cell("A4")

Save to: SalaryValue (for this create a new variable using Ctrl + K)

Get formatted text: checked

Add a Write Line activity and it shall be possible to see the value.

Example:

20.png