How to I open the latest created excel file in a folder which the folder is in another folder

  1. Directory.GetDirectories() will give you all folders as array
  2. Then loop through array using for loop
  3. In the for loop add assign and use Directory.GetFiles().OrderByDescending(function(s) System.IO.file.GetCreationTime(s)).First() this to get the latest file path.

Instead of 1 and 2 you can use for each folder in folder as well

So you need to use only one for loop for the directories

cheers