Exception has been thrown by the target of an invocation. assign activity

hi i’m encountering this issue since yesterday and i still don’t have progress with this
11H2: Can not assign ‘oneyear’ to ‘DepEdDT.Rows(25).Item(0)’.
rows(25) is where i want to write the data
when i run the program with this syntax i encounter error
but when i changed Rows(25) to Rows(24). it works.

the problem is it writes in the wrong cell which is my column name



this is where i want to write the value

this is the output when i use Rows(24)

HI,

Can you share content of $exceptionDetails in Locals panel when this error occurs in debug mode?

Regards,

Hi,

There should be $exceptionDetails in Locals panel as the following. Can you share its contents?

Regards,

RemoteException wrapping System.InvalidOperationException: Can not assign ‘oneyear’ to ‘DepEdDT.Rows(25).Item(0)’. —> RemoteException wrapping System.IndexOutOfRangeException: There is no row at position 25.
at System.Data.RBTree1.GetNodeByIndex(Int32 userIndex) at lambda_method(Closure , ActivityContext ) at System.Activities.ExpressionUtilities.IndexerLocationFactory1.CreateLocation(ActivityContext context)
at Microsoft.VisualBasic.Activities.VisualBasicReference1.Execute(CodeActivityContext context) at System.Activities.CodeActivity1.InternalExecuteInResolutionContext(CodeActivityContext context)
at System.Activities.Runtime.ActivityExecutor.ExecuteInResolutionContext[T](ActivityInstance parentInstance,
Activity1 expressionActivity) at System.Activities.OutArgument1.TryPopulateValue(LocationEnvironment targetEnvironment,
ActivityInstance targetActivityInstance,
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)
— End of inner exception stack trace —
at System.Activities.Statements.Throw.Execute(CodeActivityContext context)
at System.Activities.CodeActivity.InternalExecute(ActivityInstance instance,
ActivityExecutor executor,
BookmarkManager bookmarkManager)
at System.Activities.ActivityInstance.Execute(ActivityExecutor executor,
BookmarkManager bookmarkManager)
at System.Activities.Runtime.ActivityExecutor.ExecuteActivityWorkItem.ExecuteBody(ActivityExecutor executor,
BookmarkManager bookmarkManager,
Location resultLocation)

Hi,

System.IndexOutOfRangeException: There is no row at position 25.

This message shows there is no datarow : DepEdDT.Rows(25). Can you check if your datatable has 26 or more rows?

Regards,


the column name with yellow mark is the rows(24)
and below is the rows(25)

Hi,

How did you create DepEdDT datatable? Probably, the datatable doesn’t have row(25). Can you check number of rows in Locals panel when exception occurs?

Regards,



the Rows(24) is the column name

Hi,

In this case, please use AddDataRow activity to add Row(25) in advance. Can you try this?

image

Regards,


this is my excel file where i want to write the value

the other works fine but the last one is not

Hi,

Do you use ReadRange activity to create DepEdDT datatable? If so, can you try to add the above AddDataRow activity as it is just after the ReadRange activity? Probably it will work.

Regards,

i used invoke to read the excel

HI,

It’s fine to put AddDataRow just after the InvokeWorkflowFile activity.

Regards,

hello sir. thank you for answering my questions. we solve the issue in other ways.
the bot don’t read the rows(25) cause there’s no value in it so we indicate my start reading cell and end reading cell solved the problem. thank you very much

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