Read Range: Expression Activity type 'VisualBasicValue`1' requires compilation in order to run. Please ensure that the workflow has been compiled

Hello, I’m having issues with UiPath retrieving the latest excel workbook file (xlsx)
The code that I’m using is
String.Join(“”,Directory.GetFiles(“file location”,“*xlsx”,SearchOption.AllDirectories).OrderByDescending(Function(d) New FileInfo(d).CreationTime).Take(1))

There seems to be no error with the the code but when compiling I get
Read Range: Expression Activity type ‘VisualBasicValue`1’ requires compilation in order to run. Please ensure that the workflow has been compiled.


image

@Jonnathan_Fernandez
Welcome to the forum
can you check that only this type of double quote is used: "

I believe everything is in double quote

ok, now also we do see the end from statement within the box

unfortunately a first replication rnd did not provoke this issue

find some visualizations for Windows target framworks here
grafik

So as visualized above following did return the string / Filepath of oldest file
Directory.GetFiles(...................................).First()

give a try at this statement if possible

Would the code then change to
String.Join(“”,Directory.GetFiles(“file location”,“*.xlsx”,SearchOption.AllDirectories).First()
?

without join, have a cross check on the immediate panel screenshot

Hi,

It seems your expression contains non-0x22 double quote as the following image.

Can you try to replace these double quotes with " (0x22)?

Please also see the following post.

Regards,

2 Likes

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