im trying to copy a row from one workbook and paste it to another workbook.
I would like to copy the entire row (which is a bit long).
I actually have to open several workbooks and get the first row and paste it into another workbook (lets call it main workbook)
I guess you can read range from all and if columns are the same you can store everything into a data table and at once dump it in the new workbook. (Write range without creating the workbook will create one file for you)
If you want to replicate then dynamic write range with incrementing the file names can also be done.
Welcome to UiPath community buddy
Kindly follow the below steps that could help you resolve your issue…
1.use a assign activity and get the file path of all the workbooks you have, with a variable of type string array
Infilepath = Directory.GetFiles(“yourfoldername”,“*.xlsx”)
Which would give the file path of all the excel as a array of string
2. Use a for each loop and pass the above variable as input and change the type argument as string in the property of for each loop
3. Inside the for each loop, use Excel application scope and mention the filepath input as item, the variable obtained from for each loop which has the file path in a array
4. Next to this use a read range activity and mention the range as “A1:M2”
Here i mention as M, you can mention the columnname you have in your workbook…and the reason why i mentioned as 2 next to M is as you said we need the first row alone…
5. Now use a write range activity from workbook activities ( not under excel activity )
Where mention the workbook file path second workbook B and mention the sheet name where you want to enter the above obtained data from read range activity…and mention the range as “”
Thats all buddy you are done
Hope this would help you buddy
Kindly try this and let know for any queries
Cheers @blend