Starting robot with assistant - filePath as argument

Hello everyone,
and please excuse my poor english.

I 'd like to start a robot using a filePath as argument, so as to work on a specific file each time the robot is launched…
When i start the robot using assistant, there is always an error “invalid Character in filepath”.
When i start the robot using Studio in debug mode, with the filepath as argument, there is no error.
When I start the robot in command line, with the argument in JSON, there is no error.

The value in my parameter “in_fichier” :

Here is the error :
à System.IO.Path.CheckInvalidPathChars(String path, Boolean checkAdditional)
à System.IO.Path.GetExtension(String path)
à UiPath.Excel.Activities.WorkbookActivity1.ConstructWorkbook(String path, String password, Boolean createNew) à UiPath.Excel.Activities.WorkbookActivity1.BeginExecute(AsyncCodeActivityContext context, AsyncCallback callback, Object state)
à System.Activities.AsyncCodeActivity.InternalExecute(ActivityInstance instance, ActivityExecutor executor, BookmarkManager bookmarkManager)
à System.Activities.ActivityInstance.Execute(ActivityExecutor executor, BookmarkManager bookmarkManager)
à System.Activities.Runtime.ActivityExecutor.ExecuteActivityWorkItem.ExecuteBody(ActivityExecutor executor, BookmarkManager bookmarkManager, Location resultLocation)

Can you help with this ?


Hi @floyd203

Try Using Replace Function in a Path.

YourPathVariable.Replace(“[”, “\").Replace(”]“,”")


Thank you for your response.
It does not work. there is still an error “invalid Character” when launching with UIpath assistant.

Hi @floyd203

Check with the thread below similar query as yours!


I tried to :
empty %USERPROFILE%/.nuget
open Studio.
close Studio
open assistant
install and launch my process with the filepath as argument
=> still an “invalid character” error

Found my solution :
to enter a filepath as argument, one should escape backslashes.
example “c:\\temp\\file.xlsx”

from :

1 Like

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