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.
ppr
(Peter Preuss)
October 25, 2022, 8:07pm
2
@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
ppr
(Peter Preuss)
October 25, 2022, 8:33pm
4
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
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()
?
ppr
(Peter Preuss)
October 25, 2022, 10:18pm
6
without join, have a cross check on the immediate panel screenshot
Yoichi
(Yoichi)
October 25, 2022, 11:13pm
7
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.
Hi,
In windows legacy, it seems double quote is normalized and any double quote characer is accepted. However, at this time, in windows (.net6) ,in fact, only " (0x22) is accepted to express string literal. To make matter worse, it seems to occur only compiling. (Expression validator don’t raise an alert.)
FYI, the following is sample for reproducing. The first Assign uses " 0x22 and second Assign uses “ and it fails in compiling.
Sample20221013-2.zip (2.1 KB)
[image]
Regards,
Regards,
2 Likes
system
(system)
Closed
October 28, 2022, 11:13pm
8
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.