Use Case Description

I am having some trouble with InsertAt. This was what I used: TrackerStorage.Rows.InsertAt(row, temp), but am still getting error —Expression does not produce value—. I will greatly appreciate if you can share the syntax of using InsertAt.

I am actually trying to Insert a Row in a Particular row of Exel. I will also appreciate if you can share a better way of doing this instead of InsertAt. Thank you!



Other information about the use case

Industry categories for this use case: Other Sector

Skill level required: Beginners

UiPath Products that were used: UiPath Studio

Other applications that were used: -

Other resources: -

What is the top ROI driver for this use case?: Other

give a try on using it within an invoke method activity

How do I implement that if you don’t mind?


1 Like

Just did this but still gets an error that say ‘DataRowCollection’ does not have a public instance method named ‘InsertAt’ matching the parameter types, generic type arguments, and generic type constraints supplied to InvokeMethod ‘Invoke Method’.

refer again to the screenshot from above first parameter is of DataType: DataRow

Docu here:

Also the value of first parameter is the datarow that you want to insert and not the datatable

Yeah, I tired public void InsertAt (System.Data.DataRow row, int pos); already with TrackerStorage.Rows.InsertAt(row, temp).
That was my initial question and my error was Expression does not produce a Value

the fact is that this method is not returning a value ( a void method, Subroutine)
Thats why you got the first exception

the other exception was baout the missuse of datatypes not matching the method signature
For this also the docu link was shared.

Is it more clear to you now?

What Docu link explains the mismatch of datatypes so I can go over it?

the provided microsoft docu link from above clearly states:


also was shown in the screenshot:

Sir I saw this but I clearly don’t understand. I will appreciate if you can explain how mine is mismatched so I can gain knowledge else I will just create a new question activity

thats your screenshot

there is a datatable passed but a datarow is needed

Thank you very much for the clarification.
But I still get error with a DataRow. Also with the Int32 datatype but I converted that.

Here is the issue:

the variable TrackerStorage is of datatype: DataTable
But you have to pass a variable that is of datatype DataRow

Okay do I convert that? or what do I do about that? My Variable TrackerStorage is a DataTable from a read range Excel file.
I am trying to insert the row in-between the Exel file, and the variable TrackerStorage with has DataTable as it datatype is where the Excel table is store for the UiPath.

Do you understand?

the row is variable with a variable name ( we cannot know your current used variable name) of datatype DataRow.

this can be used as explained above.

Is the rowvariable correctly declared and maybe populated with values? How was it done? Maybe you can share this part of implementation by a screenshot with us. Thanks