Hello Community,
I need assistance. I have a folder and it’s in few excel file like Nancy_robot.xlsx, Angel_robot.xlsx. Now I want to open excel file one by one and select column C. Please any one can help me. That Will be best if you upload code.
The above expression will read all Excel files from that folder and will give output as array of string. Then use For Each loop to itreate one by one file.
ForEach item in varStrFiles
Excel Application Scope
use Read Column
To know more about Read Column Activity then please check below thread.
Hello,
Thanks for your explanation.In my folder .xlsx file have more. Please let me know I need to open few required excel file one by one.Which every file name ends with anything_robot.xlsx. like anna__robot.xlsx, angel__robot.xlsx this type of file I need to open. Please give me the solution.
Hi @Jesmine,
Please check this workflow i kept 2 files in the folder and opening them. Looping ThroughFiles.zip (28.2 KB)
If you find useful mark it as solution.
Cheers.
Vashisht.
Hello, @Vashisht can you tell me that I have done it using for each activity. But I have another for each activity, which in activity I want to use it.
When matching the item In another for each activity Bot open hole excel file in folder. It should be one item match then one excel file open. Then another match after that another excel open.
Now I need to solve this.Please take care it.
Thanks
Thanks @lingamg , but its I have done before. Please check my code on for Now I am not able to upload here because I am new. Have any email?
I need open single *_robot.xlsx file when matching 1st condition. again matching 2nd condition then open another_robot.xlsx file.
Note: In your code open hole file together like *_robot.xlsx file in folder. lease give me the solution as well as.
Hi @Jesmine you want to open excel files one by one from the folder, right.
so, do like this-
Take an assign activity----> excelFilePath=Directory.GetFiles(“your file path”,“*xlsx”)
Note: the excelFilePath variable should be String type.
Take one forEach activity and pass this variable (excelFilePath) and take ExcelApplicationScope activity inside the ForEach activity and instead of file path give like this- item.ToString
Inside that ExcelAppScope activity take one Read Range activity of Excel
and now definitely you will able to open each excel file one by one…try like this Main.xaml (8.8 KB)
Thanks @kumarD. I have done it. I need to use it in for another 1.ForEach activity. So when I use it in another 1.ForEach activity. when satisfy first 1.ForEach activity then open all robot.xlsx file in folder together. Again go to 1.ForEach and if satisfy it then check 2.ForEach activity if it satisfy then open another robot.xlsx file. Hope you are understand.
I want to share my code but I am not able to upload for new user.It’s UiPath guideline. How can I share with you my code?
Hi, Good Morning @Jesmine
I can’t understand that what you wanna do, what is your requirement?
So, can you please explain to me again…
And another thing is, in your screen shot you taken a assign activity to get all the excel files from the specified folder and you stored in a StringArray variable. Till this you did correctly but on the next step you taken a ForEach Row activity, here i didn’t understand why and inside the IF activity you used a ForEach activity, again here i didn’t understand that also why?
So, kindly explain to me in simple words then i may help you…!
Thanks @kumarD ,
I want (step1)first condition matching then open(step2) “*robot.xlsx” again (step1) 2nd condition matching (step2)open another “*robot.xlsx”.
Please check my attachment.workflow.zip (71.5 KB)
If I will get the solution from you that is very helpful for me.