Browse for folder on Windows 11

Newbie here. Thanks for helping.
I am following the course and am stuck at the “for each” section.
I have added the browse for folder at the sequence.
It opens a window op W11 where I have only Desktop to choose from.
When I debug I get:
System.NotSupportedException: Expression Activity type ‘VisualBasicValue`1’ requires compilation in order to run. Please ensure that the workflow has been compiled. at System.Activities.Expressions.CompiledExpressionInvoker.InvokeExpression(ActivityContext activityContext) at assign new FileName.

I downloaded the “for each” demo files. And executed them.
I see a lot of downloading, I don’t get the error, but I get the same issue.

Is this related to Uitpath ? I used the original files and the converted Windows ones. No difference.
Any help will be appreciated.
Thank you, Joe

Hi @Joe_Wehrens

In your files…replace the inverted comma again…

" this is how it looks… “ may be you are having few like this


Hi @Joe_Wehrens

Can you please send the expression you have used “for each” to loop through files?


@Anil_G , @srinic thank you for your help.

I found out that in the Log Message de text New File name was not recognized as text for some reason.
I copy pasted again and now it worked.

However; I still cannot browse for files.
Any ideas ?


Can you eplain what that browse part is…



I am also having same issue, while using selectfolder/Browser For Folder on my Windows 11 machine.
There is no option to choose any folder other than desktop.


Hi @sujitsamal.z @Joe_Wehrens

Instead of browsing give the required directory path in it… it would still work… that would not give any trouble in your assignment as well…

Go ahead and populate the directory path in it directly

The display name is different but the fuction of it is same as select folder



Thanks for you response.

This is an attended solution, as part of the process the robot prompts user to choose certain folder from users machine while the robot is running.

For that I have used selectfolder activity, it prompts the users to choose folder but it works only on desktop.

If the user wants to select another folder e.g Download folder, there is no option to select.



Change the automation and bit and use it

Use a prompt message and let the user give the input in a string format for the required folder

then read the string and use the folder


Hi Anil,

Yes that will work as a work around, but wanted to know what’s the reason its not working with file explorer.

thank you for your response.



Its more about the windows 11 upgrade…because of the ui change then functionalities are different


Thank you all for responding.
It looks there is a workaround, but it needs to be addressed to “repair” the select folder option.

regards, Joe

1 Like