WorkbookApplication.ReadCell VB

I’m trying to read a cell from Excel within a scope. I would like to output in a messagebox "ExcelWorkbookScope.ReadCell(“A1).ToString” but the function talks about a parameter “Type T”. Unfortunately I can’t find any documentation about it. Anyone can help how to use this function?

The idea was just print a value without having to create a variable, read the cell with an activity and then show the message box.


It seems that you need to specify the type of variable as well. I’ve tried Scope.ReadCell(Of String)(“A1”) but now I have the error: Object reference not set to an instance of an object.

I’m pretty certain the Scope variable is initialised so i’m not sure what part of it is causing the error.

RemoteException wrapping System.NullReferenceException: Object reference not set to an instance of an object.
at UiPath.Excel.WorkbookApplication.ReadCell[T](String range, Boolean preserveFormat)
at lambda_method(Closure , 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.InArgument1.TryPopulateValue(LocationEnvironment targetEnvironment, ActivityInstance activityInstance, ActivityExecutor executor)
at System.Activities.RuntimeArgument.TryPopulateValue(LocationEnvironment targetEnvironment, ActivityInstance targetActivityInstance, ActivityExecutor executor, Object argumentValueOverride, Location resultLocation, Boolean skipFastPath)
at System.Activities.ActivityInstance.InternalTryPopulateArgumentValueOrScheduleExpression(RuntimeArgument argument, Int32 nextArgumentIndex, ActivityExecutor executor, IDictionary2 argumentValueOverrides, Location resultLocation, Boolean isDynamicUpdate) at System.Activities.ActivityInstance.ResolveArguments(ActivityExecutor executor, IDictionary2 argumentValueOverrides, Location resultLocation, Int32 startIndex)
at System.Activities.Runtime.ActivityExecutor.ExecuteActivityWorkItem.ExecuteBody(ActivityExecutor executor, BookmarkManager bookmarkManager, Location resultLocation)