Open the downloaded excel file

The problem is it is not taking the file recently generated with date time. it is taking other file so it is empty and throwing error.

Then use this.
string newestFile = Directory.GetFiles(downloadsFolder).Where(Function(x) new FileInfo(x).CreationTime.Date = DateTime.Today.Date).First()

I am getting this error “CompareExcel : Sequence contains no elements”

Its working… with “Directory.GetFiles(“Desktop”).OrderByDescending(Function(f) New FileInfo(f).LastWriteTime).First()”

Hi Dilip,

this expression is working, but it is taking recently edited excel file “Directory.GetFiles(“Desktop”).OrderByDescending(Function(f) New FileInfo(f).LastWriteTime).First()”
this expression is not working, “Directory.GetFiles(downloadsFolder).Where(Function(x) new FileInfo(x).CreationTime.Date = DateTime.Today.Date).First()”
throwing error saying “Sequence contains no elements”

I am using assign to directory.get files. I then want to open all the files one at a time and do some simple formatting - delete columns etc and then save. I got the for each and if and put if file ends with .xls and the put the excel scope in the then but it does not like the variable name I assigned to the directory of files. So how do I get the files within the folder to open!!
image

Hi,
Here we go.
openexcelfiles.xaml (10.5 KB)

1 Like

Thank you - I discovered what I was doing incorrectly and it worked! Now I need to email the formatted excel files to different outlook groups based on file name!! Thanks again for your responses.

Can you give an example how I would use an excel data feeder file with multiple columns - one column containing the file name and another column containing the email address. Both are set up as variables and assigned to the column names. Need to go through many rows and email a designated user group with the corresponding file.

Thanks

Hi,

Directory.GetFiles(“C:\Users\User\Downloads”).OrderByDescending(Function(f) New FileInfo(f).CreationTimeUtc).First()

I used the above expression to get the last downloaded file. But it is giving the previously downloaded file. Can you please help on this

hi . can you please send me the workflow for getting the recently generated excel file in download folder. Thank you.

Hii ,
when iam running the workflow with this expression iam getting an error like

Capture

Is your file variable an array of Strings(String[]) and your item TypeArgument in For each - String?

hii @ovi,
Yes, i want the last download excel which is stored in the download.can you please help me on that.
Thank you.