I am making a robot that needs to every 5 minutes filter through unread emails by a specific subject line, and then open the excel file that is attached to that email. I figured out how to filter through the emails but I do not know how to open the excel file because it is a different excel file every email.
Also, I need to save the excel attachment to a folder before I open it
Hi @dev.patel
You can use the save attachment activity to save the excel attachment in the local folder.
Then you can pass the same file path to the Excel activities to perform excel operations on excel.
Hope it helps!!
Hi,
Once you read the mails.
Then use for each. Iterate your mail list. Inside for each use save attachment activity to save attament in specific folder.
Thanks
After save attachments activity, insert an assign activity to get the recently downloaded file in a folder,
- Assign -> DownloadedFile = System.IO.Directory.GetFiles("YourFolderPath").OrderByDescending(Function(d) New FileInfo(d).LastWriteTime).FirstOrDefault()
Then DownloadedFile variable contains the recently downloaded file path you can pass that variable in the Workbook path in Use excel file activity.
Hope you understand!!
Save email attachments activity will have an output variable…which will give the path to downloded file
Use output(0) to get the filepath
Cheers
When I assign DownloadedFile to the value you have there, it gives me an error message saying, “Assign: Could not find a part of the path ‘C:\Users\robmorgandev\Documents\UiPath\Maxon Serial Numbers-Dev\YourFolderPath’.”
What do I put instead of YourFolderPath
Sorry I am new to UiPath
You have to give the folder path not file path.
Give the proper path in the folder path place in the expression, the path has to be within the double quotes… @dev.patel
Hope you understand!!
I figured out how to open the excel file and read range however my next step is to delete duplicate rows from a specific column in the same data table. How would I do that?
Thank You
you can use this
filtereddt = dt.AsEnumerable.GroupBy(function(x) x("ColumnName").ToString).Select(function(x) x.First).CopyToDataTable
cheers
What activity would that be?