Read range any Excel file in ConfigFile path

Hi,

I am making project where I am using CofigFile.
First step: Robot saves the attachment (Excel file) in specific folder due to the path from Config File.
In Cofig File: TempFolder1 = Data/Attachments/NewAttachment
I used “Save Attachments” activity, in folder path: In_Config(“TempFolder1”).ToString
It works correctly. I have Excel File in Data/Attachments/NewAttachment

My quetion is:
How I can use “Read Range” activity to use this Excel file but with dynamic workbook path?

Every time I will run the process, this Excel file will have different name but will be in the same folder.

Please note that I would like to specify that robot should use only .xlsx file.
Sometime in the folder Data/Attachments/NewAttachment can be .xlsx file and something more (e.g. .docx).

Hi @PLICHTA_Aleksandra

How about this expression

Use Assign activity

Arrstring || DataType Array(String)

Arrstring = Directory.GetFiles(Environment.CurrentDirectory+"\Data\Attachments\NewAttachment\","*.*",SearchOption.AllDirectories)

or

Arrstring = Directory.GetFiles(Environment.CurrentDirectory+"\Data\Attachments\NewAttachment\","*.xlsx")

Use Read Range activity

Arrstring(0)

Regards
Gokul

1 Like

Directory.Getfiles(FolderPath,“*.xlsx”).First()

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