Hello,
I have multiple spreadsheets and I need to exract the information in the cell B9 from all spreadsheets and save it in an excel file. How can I do that ?
In For Each I add read cell activity but it reads the cell B9 from the first excel file only.
Somebody can help me ?
Thank you very much.
Hey,
you should use ‘for each’ activity for every excel file from the folder.
So for example you can do something like this:
edit.
argument for activity ‘for each’ please set as ‘string’
Directory.GetFiles("C:\ExcelFiles\ ")
Hi
Welcome to uipath forum
Hope the below steps would help you resolve this issue
- Use a assign activity like this
arr_filepaths = Directory.GetFiles(“yourfolderpath”)
Where arr_filepaths is a array of string variable
-
Now use a BUILD DATATABLE activity and create a single column named Output of type string and get the output as finaldt
Next to this build datatable activity use a Clear datatable activity and mention the input as Finaldt -
Then use a FOR EACH activity and pass the above array variable as input and change the type argument property as String
-
inside the loop use a excel application scope and pass input as item.ToString
Inside the scope use a read cell activity with cell range as “B9” and get the output as string variable named Strinput -
Now use a Add Datarow activity and pass the input in ArrayRow property like {Strinput.ToString} and datatable as Finaldt
So Your Finaldt will have all the B9 values in it
Cheers @mihaela.draghici
Thank you so much. It worked.
Thank you so much.
@mihaela.draghici
I’m glad that it helped you. Could you mark ‘solution’ option on my post ?
Thank you
Done Thanks again.
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.