Read Excel File

I want to read the excel file from the particular folder.
In that folder only one excel file will be there but name of that file will get changed.

so everytime when bot runs he only pick the excel file from that folder

I am using excel application scope but in the scope we have to mention file name too so this is not working for me

Hi @avinash.wankhede

Try this:
arr_excelFiles = Directory.GetFiles("C:\YourFolderPath", "*.xlsx")

In excel application scope, use arr_excelFiles(0).ToString

or

str_excelFile = Directory.GetFiles("C:\YourFolderPath", "*.xlsx")(0)

In excel application scope, use str_excelFile.ToString

Hi @avinash.wankhede

Use For each file in folder activity in that use Excel application scope

Hi @avinash.wankhede ,
You can use that


my code
Sequence.xaml (10.3 KB)

regards,

Hi @avinash.wankhede

Directory.GetFiles("C:\YourFolderPath", "*.xlsx")(0)

It pick the first excel file

or use
For each file in folder

image

Hope it helps!!

you can mention like this directly in the for each

so it will take only excel files from the folder

@avinash.wankhede

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