Invoke Code Vb.net error

Hi All,

Good Morning,

I’m facing issue on Invoke code, My Business process is Read Excel and add two rows and write in sample excel sheet by using Invoke code in VB.net

Dim row As DataRow
Dt1.Columns.Add(“English”)
For Each row In Dt1.Rows
DT2= (CInt(row(“English”)).ToString)+(CInt(row(“Tamil”)).ToString)
Next row

This my code. If any changes is there kindly intimate me.

Kindly gave solution.

Regards,
Santhosh Kumar M

Hi,

Can you share content of $exceptionDetails in Locals panel?
And also share what you want to achieve with input and expected output?

Regards,

Hi Yoichi,

Good Morning!

PFA and i need to add English and tamil row update with Total_Mark column by using Invoke Code.

Regards,
Santhosh Kumar
New Microsoft Excel Worksheet.xlsx (8.6 KB)

Hi @Santhosh_Kumar3

How about this expression?

(From d In Dtread.AsEnumerable
Group d By k=d("Name").ToString.Trim Into grp = Group
Let sum = grp.Sum(Function (x) CDbl(x("English").toString.Trim)+CDbl(x("Tamil").toString.Trim))
Let ra = New Object(){k,grp.First()(1),grp.First()(2),sum}
Select r = DtClone.Rows.Add(ra)).CopyToDataTable

Check out the XAML file

Total&AVG.xaml (9.1 KB)

image

Output Snap

image

Regards
Gokul

Hi @Santhosh_Kumar3

Add this Write Range activity too in the XAML file.

image

Regards
Gokul

Hi,

Kindly explain this Vb Script.

regards,
Santhosh

Hi,

If you need to just update Total_Mark column, the following will work.

Dim row As DataRow
For Each row In Dt1.Rows
row("Total_Mark")= CInt(row("English"))+CInt(row("Tamil"))
Next row

Sample20221205-7.zip (8.7 KB)

Regards,

This is the LINQ expression and check out this tutorial @Santhosh_Kumar3

Regards
Gokul

Hi All,

Thanks for your support and I got answer by different method.

Thanks All,

Regards,
Santhosh Kumar M

1 Like

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