Hello, I am fairly new to developing unattended bots so not sure how to resolve this issue. I have a working process that is being converted from Legacy to VB, Windows, however all the “Move File” activities are now displaying errors. How should I handle these? (Screenshot included with errors)
Hi @Ashley_Bell
try passing .ToString.
- To: in_ArchiveFolder.ToString
- From: item.ToString
If this resolves your issue kindly mark this as a solution.
All the best
Hi Ashley,
After converting your process from Legacy to Windows (VB), you’re seeing an error in the Move File activity due to type incompatibility. This happens because, in Windows-compatible projects, Move File
expects inputs of type IResource
instead of plain String
paths.
To resolve this:
-
Wrap your source file path using:
New FileResource(item.ToString)
-
Wrap your destination folder path using:
New FolderResource(in_ArchiveFolder.ToString)
This tells UiPath that you’re explicitly passing a file or folder as a resource, which aligns with how modern activities are designed to work in Windows (VB) environments.
Also, if you’re using a For Each File in Folder activity, CurrentFile
is already an IResource
, so no conversion is needed in that case.
Try updating your expressions accordingly — this should fix the error. Let me know if you face any further issues!
there was a concept change from string (FilePath) to IRessources
give a try at
LocalResource.FromPath(item)
LocalResource.FromPath(in_ArchiveFolder)
let us also know which package version of UiPath.System.Activites is used
I didn’t even think to check the version of packages. I updated and it looks fine now but I have other errors to fix before I can run. Thank you!!
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.