Delete excel files in destination folder after 60 days

Delete excel files in destination folder after 60 days…

In a folder i have excel files,
using - > Directory.GetFiles(DestinationFilePath, “*.xls”) i am getting excel files
after that using foreach loop i am looping through each file ,

but after that how to get creation date and compare with present day…


Follow in attach an example to get the creation date of all .xlsx files in a folder. (6.8 KB)

Any doubts please let me know.

Hope It’s helps!


1 Like

Hi Lucas,

It says cannot open empty zip folder.


Oh, sorry.

Try this.

Main.xaml (7.0 KB)

You just have to put some Excel files (.xlsx) on the xaml folder.


1 Like


In the Main.xaml file that u have sent, where can I pass destination folder path. Because I have a folder path from where all excel files are looped through.

hi @swarna

Please try this attached sample solution for you.

just replace the folder path to your destination folder.

SwarnaSolution.xaml (6.7 KB)


1 Like

The destination folder can be pass on the dirInfo variable default value:

New DirectoryInfo(System.IO.Directory.GetCurrentDirectory )
New DirectoryInfo(“folderPath”)


1 Like

Thank you it works with folder path…

Thank you Lucas, it works.

1 Like