I would like to open the latest file from a folder.
For this I know the following code:
String.Join(“”, Directory.GetFiles(MEMORYPATH, “*”,SearchOption.AllDirectories).OrderByDescending(Function(d) New FileInfo(d).CreationTime).Take(NUMBER) )
The last times the code worked but recently I get the following error code. I thought it was the file, but even when I tested it in a new file it doesn’t work anymore.
“Sequence: Value cannot be null. (Parameter ‘path’)”
or
Use Excel File: Compilation is required to run the VisualBasicValue`1 expression activity type. Make sure that the workflow has been compiled.
How can I call the Last File inside a folder? Gladly also the last file with a certain beginning e.g. BEISPIEL_XXXX and the file BEISPIEL_1334 is opened.
What should I replace the quotation marks with (and which ones? :))
String.Join(“”, Directory.GetFiles(STORAGEPATH, “*”,SearchOption.AllDirectories).OrderByDescending(Function(d) New FileInfo(d).CreationTime).Take(NUMBER) )
String.Join(“”, Directory.GetFiles(FilePath,““,SearchOption.AllDirectories).OrderByDescending(Function(d) New FileInfo(d).CreationTime).Take(Directory.GetFiles(FilePath,””,SearchOption.AllDirectories).count-1) )