Urgent Help Required For Deleting Excel Workbook from Downloads

Hi,

Can anyone Help me with the code of how to delete any workbook from Downloads Folder.

BP5.zip (12.5 KB)

Hoping your file type is .xlsx
If other you can change it in the assign activity.
in the path variable pls give your folder path from where you want to delete the files.

Take a look at the snippet “For each file in folder” for a general structure.

On the “files” assignment, you’ll want to add the searchPattern to whatever excel workbook format you want to use (.xl should work for any and every excel workbook).

One thing to keep in mind though, getting the correct path to the downloads folder is not exactly trivial if you want it to work for every single possibility. See here

Navigate to Downloads folder (make sure you use user profile in general to make it work for all systems).
Access all the files and find Workbook using extension names
And finally delete the file from the folder.

Refer to attached XAML file containing this logic. It deletes file containing XLX*Main.xaml (6.8 KB) extension

2 Likes

Hi,

Check the attached workflow, before delete it will check whether file exist or not.
if the file exist then it will delete the file. otherwise it will return as false.
you can include this workflow into your process. This workflow created using 2019.5 UiPath studio.
Main.xaml (5.6 KB)

Thanks @keerthims.
It worked Perfectly.

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