Open Recent Excel FIle

Hello, if file name are same, but date are changed. How can I open recent date excel file.

Example:

Here, file name 30-Apr-23. But when file name 01-May-23 then I have to change folder path. Please kindly give some idea then I will no need to change folder path every time.

Hello,
If process start date and the date in the file name are the same you can use it like below;
“C:\YourCompName\Desktop\mail\Ready for Payment-”+DateTime.Now.ToString(“dd-MMMM-yy”)+“.xlsx”

If not let us know what is the rule between run time and file date.
Regards

HI Sabbir,

Here is the sample code attached if it is not resolved for you Query please let me know…

Recentfile.zip (2.8 KB)