I want to copy the name of the latest file and then copy it when I open excel and save the excel file name by the name that I already copied it
Please any idea to solve it
Hi @Imene_ZARAI,
Kindly try this assign.
strFileName = Path.GetFileName(Directory.GetFiles(yourFolderPath).OrderByDescending(Function(d) New FileInfo(d).CreationTime).Tolist(0))
Regards.
Ă–mer
thanks for the reply I will try it
Hi @Imene_ZARAI here the linq to get the last file name:
file=(
From f In New DirectoryInfo(filePath).GetFiles(“*.txt”).Cast(Of FileInfo)
Order By f.LastWriteTime Descending
Select f
).Last()
variable type should be
thank you for the reply
Hello @Imene_ZARAI
please find the below doc.
Another approach is to sue the Find Each File In Folder activity. Give Order By as “Created date newest first”.
Then use break to break from loop after getting the first file name.
Thanks
yes it worked thank you
thanks for replying
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.