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…

Hello!

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

GetCreationDate_Example.zip (6.8 KB)

Any doubts please let me know.

Hope It’s helps!

Regards,

1 Like

Hi Lucas,

It says cannot open empty zip folder.

Thanks,
Swarna

Oh, sorry.

Try this.

Main.xaml (7.0 KB)

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

Regards,

1 Like

Lucas,

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)

Regards…!!
Akshay

1 Like

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

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

Regards,

1 Like

Thank you it works with folder path…

Thank you Lucas, it works.

1 Like