How to read the excel sheet if excel sheet have a name with date dynamically?

i have download the excel sheet with daily wise and it download the forms as Unilt_20-12-2018.xlsx
next day it download Unit_21-12-2018.xlsx…so how can read the excel sheet dyanamicaaly???


Try this.

   String todayDate = Now.Tostring("dd-MM-yyyy)

   String getlatestFile = Directory.GetFiles("FolderPath","*"+todayDate+".xlsx")(0)

You will get latest file.

1 Like

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