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…

How can you check if there is a new file in a folder?
How to find when a file is created


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!



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.




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)


For each excel in a folder

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

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



Thank you it works with folder path…


Thank you Lucas, it works.

closed #10