While working with Excel, sometimes it’s necessary to find the number of records available in it.
Let’s see how to do that!!!
total_Count = my_DataTable.Rows.Count
my_DataTable : The DataTable you are working with
Implementation using UiPath :
Let us implement a workflow to count the total number of rows in Excel.
Drag “Excel Application Scope” activity into the designer panel and supply the “File Path” to it.
(Sample file has been attached in the link provided at the article’s end)
Â Â Â Â Â Â Â Â Â Â
Drag “Read Range” activity to read the Excel data and pass the mandatory fields to it like “Sheet Name” and output DataTable variable
Drag “Message Box” activity to display the rows count.
Now, run the code !!!
Click here to download the Source Code…
Hope it has helped you…