Read range from Excel file existing in specific folder

Hello,

I would like to Read Range from Excel file.
I have specific folder where I will save Excel file.
That’s why I would like to use file path due to the folder, not Excel’ name.
Excel name will be different every time, but in this specific folder will exist only one Excel file each time.
What should I write in “Read Range” activity in “Workbook path”?

hello @PLICHTA_Aleksandra
Try below

System.IO.Directory.GetFiles("C:\Temp\","*.xlsx")(0)

you can change the extension as per your need.
Example
System.IO.Directory.GetFiles("C:\Temp\","*.xls")(0)
System.IO.Directory.GetFiles("C:\Temp\","*.xlsm")(0)

@PLICHTA_Aleksandra
please check
Main (1).xaml (7.9 KB)
you can put all excel possible extention in if condition. I have put only two

Thank you!
It is exactly what I need!

1 Like

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