Reading An Excel File In UiPath

What is RPA

 
RPA stands for Robotic Process Automation,  an emerging form of business process automation technology which provides easy GUI based tools and activity to automate business processes.
 
Here we are using UiPath RPA Tool.
 
First Install RPA Tool UiPath Community Edition from here.
 
Simple Hello World and Web Scraping Projects/Program articles are already here in C# Corner.
 
Now we will create Automation using UiPath to read the data from the existing Excel file and paste that data into Notepad.
 
Step1
 
Open Uipath Studio
 
opening UiPath
 
Under New Project click on Process for blank project
 
selecting a New Project
 
It will give you the below screen,
 
New Blank Process
 
Type Name and Description then click on the Create button
 
Step 2
 
As this is a very simple step first we will be reading an excel then we will open a notepad and write the invoice number into it. So we will choose Sequence activity as everything is in linear/sequence form.
 
open main workflow
 
Click open main workflow
 
Drag sequence activity under main
 
Drag Sequence activity under main
 
Change properties displayName from Sequence to “Read Excel and paste into notepad”
 
Step 3
 
For reading an excel first we will choose the activity called "Excel Application Scope" from activities
 
Type "Excel application scope" into search activities
 
selecting excel scope activity
 
Drag it into "drag activities here" under main
 
Give the Excel path in WorkbookPath Properties or else just click … and browse to the Excel file.
 
Selecting Excel
 
Search Read Excel and drag it as below: 
 
search read cell and drag
 
Now give the cell value and Sheet name from an existing Excel sheet as below
 
giving values to existing excel
 
To store a result we need a variable

Create a variable by clicking on variable,

Select proper variable type and scope
 
create a variable
 
Pass that variable to Result.
 
pass the variable to results
 
Now we have read the data invoice number from Excel and stored it in the Variable called getInvoiveNumber
 
Step 4
 
Open Notepad Application by taking open application activity from activities.
 
open application notepad
 
Pass the "C:\windows\system32\notepad.exe" into FileName Property
 
Open Notepad
 
Click on Indicate on Screen in Open application activity and click on the notepad screen.
Click on indicate screen notepad
 
Selector for Notepad
 
selector for notepad
 
Note
Here I have replaced Notepad with '*' to make it dynamic 
 
Now we need to attach that notepad window
 
For that take attach window activity as shown
 
attach window
 
Go to indicate on screen and click on notepad
 
attach window indicate screen
 
Now choose the type into activity to type the  invoice number to Notepad
 
type into activity
 
Go to properties in text field and pass the variable that has stored the invoice number in variable getInvoiceNumber
 
pass variable to type into activity
 
Now run the automation/sequence by clicking on Debug button.
 
It will take the data from Excel and paste on notepad
 

Conclusion

 
Now you are able to write the Automation using UiPath for taking data from existing Excel and typing it to any application using type into activity. You can use the given use case explained here in any of your projects.


Similar Articles