I have an Excel file - I would like the bot to count the number of rows in the file - then run the ‘Copy Paste Slide’ in the PowerPoint package (UiPath.Presentations.Activities) activity that many times
Is this possible to do?
I have an Excel file - I would like the bot to count the number of rows in the file - then run the ‘Copy Paste Slide’ in the PowerPoint package (UiPath.Presentations.Activities) activity that many times
Is this possible to do?
Hi
I would like to understand how ur going to combine these process or are they separate process
But for now
To get the number of rows, first read that excel file using READ RANGE activity and get the output as a datatable named dt
To get row count
Int_count = dt.Rows.Count
To do that much number of time u can use copy paste within a loop like While loop with a counter variable
Where counter is a variable of type int32 with default value as 0
Condition would be
Counter < int_count
On copy pasting in power point u can do with this
Activity
https://docs.uipath.com/activities/other/latest/productivity/copy-paste-slide
Cheers @E.T.S
Hi @E.T.S
Here are the steps to do this:
DataTable.Rows.Count
property to get the count of rows in your DataTable. Store this count in a variable, e.g., rowCount
.1
to rowCount
(the number of rows in your Excel file).Make sure to configure the “Copy Paste Slide” activity inside the loop with the appropriate source and destination slides based on your PowerPoint presentation structure.
Thanks!!
Inside use excel file activity use Excel.Sheet("SheetName").RowCount
will give the count of rows
Or read the data using read range and then use dt.RowsCount
Then use the saved variable in for loop with Enumerable.Range(0,count)
Inside loop use copy/paste slide activity as needed
Cheers
Hi @Nitya1
I am trying to avoid using a for each loop as I have one already
Hi @Anil_G
I am trying to avoid using a for each loop as I have one already
I have used this and it gives the correct number of rows but when I use Counter < int_count it executes the copy and paste continously - where do I set what the Counter variable is as currently I have made the variable but it doesn’t have a value
Counter variable:
int_Count variable:
Do while:
In while loop properties you have max loop count just give the count there and give condition as true it would work till max loop is readched
cheers
Hello @E.T.S
Thanks & Cheers!!!