Loop for excels in a folder

Hi, all.

I just want to ask you how can I lay out to make a loop for excels in a folder?

I do not know how I can get the excels’ list in Download folder…

Please help… :frowning:

Hi @ymshin0421

Use For each file in folder activity

Regards,

@ymshin0421

Hi @ymshin0421

Use filterby option to get only “xlsx”.
“*.Xlsx” represents to iterate through only the excel files presents in the folder.

image

Hope it helps!!

  • for each file in folder Activity - feel free to set a filter for e.g. exlsx files

OR

.Net Statement:

  • Directory.GetFiles
  • New DirectoryInfo(“YourPath”).GetFiles(…

grafik

UPD1 - Visualizations

@ymshin0421,

Use For Each File in folder. Just remember to customize he username using this otherwise same code will not work on other machines or user ids.

"C:\Users\"+Environment.UserName+"\Downloads"

image

Thanks,
Ashok :slight_smile:

Adressing this part in detail, we can make the specific profile folder generic by:

Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile),"Downloads")

Thank you for your laying out… :slight_smile:

@ymshin0421

Hope you got the solution for your question. If yes,please mark it as solution to close the loop.

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