How to get the Currency cell values using UiPath.Excel.Activities?
For this requirement follow the below tutorial:
- Assume that an EmployeeSalaries.xlsx file is created with data as below (the rows from the column E are Currency types)
- 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]
- Add a new Sequence (for example ReadCurrencyColumns)
- Add an Excel Process Scope activity
- Inside the Excel Process Scope activity add an Use Excel File activity
- Configure the Use Excel File activity as below
Excel file: "EmployeeSalaries.xlsx"
Read formating: (null)
Save changes: checked
- Add inside Do sequence a new For Each Excel Row activity
- Configure the For Each Excel Row activity as below
For each: CurrentRow
In range: EmployeeSalariesExcel.Sheet("Sheet1")
Has headers: checked
- Add inside Do sequence a new Read Cell Value activity
- Configure the Read Cell Value activity as below
Cell: CurrentRow.ByField("Salary/month")
Save to: Salary (for this create a new variable using Ctrl + K)
Get formatted text: checked
- Add a new Write Line activity
- Inside of Write Line activity, add for the Text section the variable Salary
- On running the project, the results will be like below
- To get the whole data of the Sheet page, add a new Read Range activity
- Configure the Read Range activity as below
Range: EmployeeSalariesExcel.Sheet("Sheet1")
Has headers: checked
Read formatting: (null)
Save to: dt_EmployeeSalariesValue (for this create a new variable using Ctrl + K)
- Add a new Output Data Table activity
- Configure the Output Data Table activity as below
DataTable: dt_EmployeeSalariesValue
Text: EmployeeTextData (for this create a new variable using Ctrl + K)
- Add a new Write Line activity and for Text add EmployeeTextData as seen in the above image
- On running the project, the results will be like below
Note: The project will have these variables created
- For example to get the "A4" cell value, use the Read Cell Value activity as below
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: