Loop through folders to read excel

Hello Community,

I have to automate a process, in which the bot has to read an excel file to Write the Data in SAP afterwards.

Unfortunately, i do Not have a Solution for looping through different folders, which includes the excel files. The excel files are Always in the same Form, but it has to be read one By one.

So my two questions are:

How do i loop through folders to Work with the excel files one by one?

How can i implement a Check if a excel file available or Not in a Single folder?

Best regards

Hi @FloN

You can use the below template for your scenario. I think with a bit of tweaks you can make use of it to get your task done



Hi @FloN

str var=Directory.GetFiles(InputFilePath)

Use for each item in var

use readrange in excel and use merge datatable

Ashwin S

Hello @AshwinS2 and @Lahiru.Fernando ,

thank you your fast and kind help. I will try both of your solutions to learn from them, as i am a beginner :wink:

Best regards

1 Like

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