Excel read issues

Hello,

can someone please advise on how to read from an excel and do a if statement from an excel file I always get the error that the text might be too long. I have the following workflow configured in Uipath studioX:

Kind regards,

Tiago

Changed category to StudioX, since this is the version you’re using.

Hi, welcome to the community!
What is the type of data you have there?

Hi,

Thank you for your reply. It’s a excel file xlsx with a number, if the number is not there it works fine.

Kind regards,

Tiago

Here the error:

{
“message”: “UiPath.Excel.ExcelException: Could not read from address H2. The text you are trying to read might be too long. —> System.Runtime.InteropServices.COMException: Class Text method could not be executed WorksheetFunction\r\n in System.RuntimeType.ForwardCallToInvokeMember(String memberName, BindingFlags flags, Object target, Int32 aWrapperTypes, MessageData& msgData)\r\n em Microsoft.Office.Interop.Excel.WorksheetFunction.Text(Object Arg1, String Arg2)\r\n em UiPath.Excel.RangeExtensionMethods.<>c__DisplayClass3_0.b__1()\r\n em UiPath.Excel.ExcelApplicationExtensionMethods.TryExecuteAction(Action actionToExecuteWhenReady)\r\n in UiPath.Excel.ExcelApplicationExtensionMethods.ExecuteInReadyState(Application app, Action actionToExecuteWhenReady, Int64 timeoutMilliseconds)\r\n in UiPath.Excel.RangeExtensionMethods.<>c__DisplayClass3_0.b__0()\r\n in UiPath.Excel.ExcelContextHelper.Execute[T](Func1 func, ExcelContext context, Object[] contextParams)\r\n --- Fim do rastreio da pilha de excepção interna ---\r\n in UiPath.Excel.ExcelContextHelper.Execute[T](Func1 func, ExcelContext context, Object contextParams)\r\n in UiPath.Excel.RangeExtensionMethods.UserFriendlyText(Range cell, Object value, Application application, WorksheetFunction worksheetFunction, String cellAddress, Int64 timeoutMilliseconds)\r\n in UiPath.Excel.WorkbookMetadataOperations.InternalReadCellValue[T](String cellAddress, Int32 rowOffset, Int32 colOffset, Boolean loadMetadata)\r\n in UiPath.Excel.WorkbookMetadataOperations.ReadCellWithMetadata[T](String cellAddress, Int32 rowOffset, Int32 colOffset)\r\n em UiPath.Excel.CellIndexer.get_Item(String range, Int32 rowOffset)\r\n in lambda_method(Closure , ActivityContext )\r\n in Microsoft.VisualBasic.Activities.VisualBasicValue1.Execute(CodeActivityContext context)\r\n in System.Activities.CodeActivity1.InternalExecuteInResolutionContext(CodeActivityContext context)\r\n in System.Activities.Runtime.ActivityExecutor.ExecuteInResolutionContext[T](ActivityInstance parentInstance, Activity1 expressionActivity)\r\n in System.Activities.InArgument1.TryPopulateValue(LocationEnvironment targetEnvironment, ActivityInstance activityInstance, ActivityExecutor executor)\r\n in System.Activities.RuntimeArgument.TryPopulateValue(LocationEnvironment targetEnvironment, ActivityInstance targetActivityInstance, ActivityExecutor executor, Object argumentValueOverride, Location resultLocation, Boolean skipFastPath)\r\n in System.Activities.ActivityInstance.InternalTryPopulateArgumentValueOrScheduleExpression(RuntimeArgument argument, Int32 nextArgumentIndex, ActivityExecutor executor, IDictionary2 argumentValueOverrides, Location resultLocation, Boolean isDynamicUpdate)\r\n in System.Activities.ActivityInstance.ResolveArguments(ActivityExecutor executor, IDictionary2 argumentValueOverrides, Location resultLocation, Int32 startIndex)\r\n in System.Activities.Runtime.ActivityExecutor.ExecuteActivityWorkItem.ExecuteBody(ActivityExecutor executor, BookmarkManager bookmarkManager, Location resultLocation)”,
“level”: “Error”,
“logType”: “User”,
“timeStamp”: “19:15:34”,
“processVersion”: “1.0.0”,
“jobId”: “2973d531-df97-43cc-ae1a-44e6799d9535”,
“robotName”: “TIAGO”,
“machineId”: 0,
“fileName”: “GlobalHandlerX”
}

Regards,

Tiago

I think something is wrong with your data, are you sure it is formatted as number in excel?

1 Like

Many thanks Bruno formatting the number in excel did the trick!

1 Like

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