Uploading: IMG_20220605_232418.jpg…
As refer to the image , There is no row Present in your datatable at -1 index.
Can you use Row(0) In place of Row(-1).
Hello @Sabbir_Anwar ,
Can you please provide the assign statement Screenshot.
As per the error message you are assigning a value with wrong index. (If Index not sound it returns -1)
Regards,
Rohith
Hello @Sabbir_Anwar ,
Print the intRowIndex.ToString and check if you are getting the required index value.
Regards,
Rohith
Dear sir, I did not understand
In Message Box put intRowIndex.ToString
Check if you are getting value. If its is throwing error debug the issue as intRowIndex is not getting the required value from your previous expressions (where you are assigning it).
I checked, I didn’t get value. Could you please help me to design what will be the new assign value.
It would be helpful if you can explain us what are you trying to achieve here and which part you are getting error, with clear screenshot and steps that were performed by you.
This will help anyone to guide you in right path!
Regards,
Rohith
Hello @Sabbir_Anwar ,
You wanted to update the express card number for particular Employee ID from Sheet to to sheet 1 based on match right?
Hello @Sabbir_Anwar ,
-
Perform Read Range and Store the Data in DT1 & DT2 variable
-
Assign OutDt = DT1.Clone()
-
Put Assign
outDT = (From R1 In TestDt1.AsEnumerable
From R2 In TestDt2.AsEnumerable
Where (R1.Item(“employee_TID”).ToString.Trim.Equals(R2.Item(“employee_TID”).ToString.Trim))
Select R = outDT.Rows.Add((R1.ItemArray.Append(R2.Item(“express_card_number”).ToString).ToArray))).CopyToDataTable() -
Write Range to new excel
Execute the code and check if this helps.
Thank you sir for your sincere support. But The problem has been solved by using same worksheet.