Excel Application Scope for each Excel File in a Folder

Hello,

I am currently working on a flow that reads in an excel file, writes the data to a data table, then appends the data to an excel worksheet. It works great with a single file. However, I am wanting to repeat this flow for each excel file within a folder. But, each attempt to add a “For Each” activity, I cannot get the excel application scope activity to work, thus making the flow fail.

How can I run this flow for each file in a specific folder?

Here is the uipath file: Flowchart.xaml (16.3 KB)

Two example input excel files stored that are stored the same folder (first Excel Application Scope activity reads these two excel workbooks):
DEP_1101_TRAN1.xlsx (16.4 KB) DEP_1101_TRAN2.xlsx (16.4 KB)

The desired output excel workbook result (second Excel Application Scope activity appends):
combined_dep_result.xlsx (17.0 KB)

1 Like

@zrobins6

If you want to run the flow of each file you need to create an array of a file in your workflow.

arrFile =Directory.GetFiles(In_StrFolderPath) then loop into arrFile Variable

I hope I make sense

cheers :smiley:
Happy learning :smiley:

2 Likes

Thank you for your help and response! To more experienced users, I would say your answer makes perfect sense, but for myself, I am still a bit lost.

I found a walkthrough that seemed to address what you were talking about, but now I am not getting an excel output at all, so not sure if this even works. Here is a screenshot of the flow, and not certain this is what you were talking about?

1 Like

Hi @zrobins6

Apologies for that.Can you give your sourcecode and I will try to correct it and I will going to explain it also.Many Thanks

cheers :smiley:

Happy learning :smiley:

1 Like

hey @pattyricarte, is this what you are asking for?

excelextract.txt (24.1 KB)

1 Like

@zrobins6 - I have downloaded your XAML , let me add some dummy activity where you can fill the correct path , then it should work.

1 Like

@zrobins6 - I have fixed the workflow.

Flowchart.xaml (19.0 KB)

Output: Output.xlsx (13.4 KB)

Please mark this as solution, if it solves your query.

2 Likes

Hey @prasath17 this worked perfectly! Thank you very much.

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.