Thank you for your reply!
The screenshots are split into two images, but here they are!
Also, since this is part of a longer workflow, the data table is built outside the screenshots.
It doesn’t work as intended, and I get an error.
When I say it doesn’t work as intended, I mean that if the search returns multiple results for the item I’m looking for, it moves on to search for the next item without clicking anything or writing anything to Excel.
Ideally, if multiple results appear, it would click both, but that seems difficult to control, so I want it to write to the “Add Failed” column in Excel, but I can’t get it to work…
Also, it seems to be searching for the item in the results, but I don’t like that it takes one or two minutes…
I also get an error when there are no matching results. In that case, I get an error like the one below.
It also seems to take about four minutes…
Message: The SpecialCells method of the Range class failed.
Exception Type: UiPath.Excel.ExcelException
UiPath.Excel.ExcelException: The SpecialCells method of the Range class failed. —> System.Runtime.InteropServices.COMException: The SpecialCells method of the Range class failed. at System.RuntimeType.InvokeMember(String name, BindingFlags bindingFlags, Binder binder, Object target, Object providedArgs, ParameterModifier modifiers, CultureInfo culture, String namedParams)
at System.RuntimeType.ForwardCallToInvokeMember(String memberName, BindingFlags flags, Object target, Object aArgs, Boolean aArgsIsByRef, Int32 aArgsWrapperTypes, Type aArgsTypes, Type retType)
at Microsoft.Office.Interop.Excel.Range.SpecialCells(XlCellType Type, Object Value)
at UiPath.Excel.WorkbookApplication.<>c__DisplayClass47_1.b__1()
at UiPath.Excel.ExcelContextHelper.Execute[T](Func1 func, ExcelContext context, Object[] contextParams) --- End of inner exception stack trace --- at UiPath.Excel.ExcelContextHelper.Execute[T](Func1 func, ExcelContext context, Object contextParams)
at UiPath.Excel.WorkbookApplication.XlObject[T](Func`1 func, T& excelObject, ExcelContext context, Object contextParameters)
at UiPath.Excel.WorkbookApplication.EnsureAllCellsAreVisibleOrThrow(DataTable data, Range startRange)
at UiPath.Excel.WorkbookApplication.WriteRange(String range, DataTable data, Boolean includeHeaders)
at UiPath.Excel.Activities.Business.WriteRangeX.<>c__DisplayClass20_0.b__0()
at System.Threading.ExecutionContext.RunFromThreadPoolDispatchLoop(Thread threadPoolThread, ExecutionContext executionContext, ContextCallback callback, Object state)
— End of stack trace from previous location —
at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot, Thread threadPoolThread)
— End of stack trace from previous location —
at UiPath.Excel.Activities.Business.WriteRangeX.ExecuteAsync(AsyncCodeActivityContext context, CancellationToken cancellationToken)
at UiPath.Shared.Activities.AsyncTaskCodeActivityImplementation.EndExecute(AsyncCodeActivityContext context, IAsyncResult result)
at UiPath.Shared.Activities.AsyncTaskCodeActivity.EndExecute(AsyncCodeActivityContext context, IAsyncResult result)
at System.Activities.AsyncCodeActivity.CompleteAsyncCodeActivityData.CompleteAsyncCodeActivityWorkItem.Execute(ActivityExecutor executor, BookmarkManager bookmarkManager)
— End of stack trace from previous location —
at UiPath.UIAutomationNext.Activities.NApplicationCard.OnFault(NativeActivityFaultContext faultContext, Exception propagatedException, ActivityInstance propagatedFrom)
at System.Activities.Runtime.FaultCallbackWrapper.Invoke(NativeActivityFaultContext faultContext, Exception propagatedException, ActivityInstance propagatedFrom)
at System.Activities.Runtime.FaultCallbackWrapper.FaultWorkItem.Execute(ActivityExecutor executor, BookmarkManager bookmarkManager)
— End of stack trace from previous location —
at UiPath.UIAutomationNext.Activities.NApplicationCard.OnFault(NativeActivityFaultContext faultContext, Exception propagatedException, ActivityInstance propagatedFrom)
at System.Activities.Runtime.FaultCallbackWrapper.Invoke(NativeActivityFaultContext faultContext, Exception propagatedException, ActivityInstance propagatedFrom)
at System.Activities.Runtime.FaultCallbackWrapper.FaultWorkItem.Execute(ActivityExecutor executor, BookmarkManager bookmarkManager)