Send Outlook Message: Cannot Find this File. Verify the Path and File Name are Correct

I am trying to send an excel file I have downloaded from chrome that has a variable ID in an email message and am getting this error. To get the file name of the most recent downloaded file, I am using the following:

Directory.GetFiles(“C:\Users\willl\Desktop\RPA\BotAThon”).OrderByDescending(Function(d) New FileInfo(d).CreationTime).ToString(0)

I am assigning this to the variable “RecentFile” and then trying to send it with the following:

With “RecentFile” in the attach files part. Can anyone please help out? I think the issue is with the variable. Thanks.

Hi,

If you download file with Chrome browser, first it makes temporary file (.crdownload file) and put whole file when finish.
So can you check content of RecentFile using LogMessage or WrteLine activity? If it’s temporary file, you need to wait until donwloading is done.

Regards,