Getting an error value cannot be null. parameter path

Hi All, not sure where is the problem. I have a few Write Line activity in place to ensue the filepath is correct.

I would like to remove certain values from a workbook. I have 2 Write Line to ensure filename and filepath are correct before inputting the following activities in place:

  • Read Range
  • Filter Data Table
  • Write Range

Error as follows:
RemoteException wrapping System.ArgumentNullException: Value cannot be null. (Parameter ‘path’)
at System.IO.Directory.InternalEnumeratePaths(String path,
String searchPattern,
SearchTarget searchTarget,
EnumerationOptions options)
at System.IO.Directory.GetFiles(String path,
String searchPattern,
EnumerationOptions enumerationOptions)
at System.IO.Directory.GetFiles(String path,
String searchPattern)
at Namespace_4026.test2_Expressions.test2_Expressions_TypedDataContext2_ForReadOnly.__Expr0Get()
at Namespace_4026.test2_Expressions.test2_Expressions_TypedDataContext2_ForReadOnly.ValueType___Expr0Get()
at Namespace_4026.test2_Expressions.InvokeExpression(Int32 expressionId,
IList1 locations, ActivityContext activityContext) at System.Activities.Expressions.CompiledExpressionInvoker.InvokeExpression(ActivityContext activityContext) at Microsoft.VisualBasic.Activities.VisualBasicValue1.Execute(CodeActivityContext context)
at System.Activities.CodeActivity1.InternalExecuteInResolutionContext(CodeActivityContext context) at System.Activities.Runtime.ActivityExecutor.ExecuteInResolutionContext[T](ActivityInstance parentInstance, Activity1 expressionActivity)
at System.Activities.Variable`1.PopulateDefault(ActivityExecutor executor,
ActivityInstance parentInstance,
Location location)
at System.Activities.ActivityInstance.ResolveVariable(Variable variable,
ActivityExecutor executor)
at System.Activities.ActivityInstance.ResolveVariables(ActivityExecutor executor)
at System.Activities.Runtime.ActivityExecutor.ExecuteActivityWorkItem.ExecuteBody(ActivityExecutor executor,
BookmarkManager bookmarkManager,
Location resultLocation)

I have 3 string variable and a variable for Data Table.

Tried referring to this thread but I was still not able to solve the issue
test2.xaml (9.5 KB)

https://forum.uipath.com/t/getting-error-on-running-the-robot-saying-value-cannot-be-null-parameter-name-value/90744

Hi @Justine

I see a environment.newline in folder path why are you having it? … it means to add a enter in the string and in folder path you cannot give that… that is the reason you are getting this error

And as a best practice please do your assignin of other variables in the assign activity and not in default please please move them to assign activity

Cheers

Hi @Anil_G , i was using Environment.userName. Ok noted on the assign values.

Hi @Justine

Please check if username is having any special characters that you dont want in path. Bacause the error says there is aomething not good or the path is empty

Cheers

1 Like

Hi @Anil_G , went to redo the whole workflow. manage to get the workflow working. thanks!

1 Like

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