# Invoke Code - VB Issue

**URL:** <https://forum.uipath.com/t/invoke-code-vb-issue/798817>\
**Category:** Studio\
**Tags:** activities-panel, question, studio, system, activities\
**Created:** [January 3, 2025, 6:50am UTC](https://forum.uipath.com/t/invoke-code-vb-issue/798817 "2025-01-03T06:50:36Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![besakkiappan46](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/besakkiappan46/32/496850_2.png) [@besakkiappan46](https://forum.uipath.com/u/besakkiappan46)\
**Post date:** [January 3, 2025, 6:50am UTC](https://forum.uipath.com/t/invoke-code-vb-issue/798817/1 "2025-01-03T06:50:36Z")

</div>

Hi  
I am using invoke code to loop around a datatable and update a specific column value from “Subject to revie” to “Subject to review”  
I get syntax error at line 2. What could be the issue? I’m using VB . I pass the dt\_Req as In/Out argument and it is a Datatable

For Each row As DataRow In dt\_Req.Rows  
If row(“Status”).ToString().Trim().ToLower() = “subject to revie” Then  
row(“Status”) = “Subject to Review”  
End If  
Next

---

<div class="post-metadata">

**Author:** ![erkanceylan](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/erkanceylan/32/462481_2.png) [@erkanceylan](https://forum.uipath.com/u/erkanceylan)\
**Post date:** [January 3, 2025, 7:03am UTC](https://forum.uipath.com/t/invoke-code-vb-issue/798817/2 "2025-01-03T07:03:55Z")

</div>

Hi @besakkiappan46

You should make sure that you set the argument as DataTable in the invoke code activity. You should not get any errors. If you still get errors, you should try closing UiPath Studio and reopening it.

 ![The image shows the "Invoked code arguments" section for a program, displaying a DataTable argument named "dt_Req" with an input/output direction. (Captioned by AI)](https://global.discourse-cdn.com/uipath/original/4X/7/d/e/7de01104d94d20a69969d3d57330f1da99ef0efc.png)

---

<div class="post-metadata">

**Author:** ![besakkiappan46](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/besakkiappan46/32/496850_2.png) [@besakkiappan46](https://forum.uipath.com/u/besakkiappan46)\
**Post date:** [January 3, 2025, 7:10am UTC](https://forum.uipath.com/t/invoke-code-vb-issue/798817/3 "2025-01-03T07:10:32Z")

</div>

I passed in the similar way only. I tried closing and Opening. No luck. Can you Share screenshot of your code? Just wanted to see if you are getting any Error.

---

<div class="post-metadata">

**Author:** ![erkanceylan](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/erkanceylan/32/462481_2.png) [@erkanceylan](https://forum.uipath.com/u/erkanceylan)\
**Post date:** [January 3, 2025, 7:27am UTC](https://forum.uipath.com/t/invoke-code-vb-issue/798817/4 "2025-01-03T07:27:45Z")

</div>

I’ve just copy your code above. it was not occurring an error.

---

<div class="post-metadata">

**Author:** ![ashokkarale](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/ashokkarale/32/474400_2.png) [@ashokkarale](https://forum.uipath.com/u/ashokkarale)\
**Post date:** [January 3, 2025, 7:29am UTC](https://forum.uipath.com/t/invoke-code-vb-issue/798817/5 "2025-01-03T07:29:50Z")

</div>

@besakkiappan46,

Make sure your code is following these points:

1. **Capitalization and Punctuation** : Ensure every statement ends with a proper punctuation mark, including the main statement block indicators.
2. **Quotes and Case Sensitivity** : Verify that the string comparisons are accurate in terms of quotes and casing.

Try this code:

```auto
For Each row As DataRow In dt_Req.Rows
    If row("Status").ToString().Trim().ToLower() = "subject to revie" Then
        row("Status") = "Subject to Review"
    End If
Next

```

---

<div class="post-metadata">

**Author:** ![besakkiappan46](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/besakkiappan46/32/496850_2.png) [@besakkiappan46](https://forum.uipath.com/u/besakkiappan46)\
**Post date:** [January 3, 2025, 11:22am UTC](https://forum.uipath.com/t/invoke-code-vb-issue/798817/6 "2025-01-03T11:22:52Z")

</div>

Thanks. it worked. I restarted the studio. I don’t see that Error

---

<div class="post-metadata">

**Author:** ![system](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/system/32/182466_2.png) [@system](https://forum.uipath.com/u/system)\
**Post date:** [January 6, 2025, 11:23am UTC](https://forum.uipath.com/t/invoke-code-vb-issue/798817/7 "2025-01-06T11:23:31Z")

</div>

Closed on January 6, 2025, 11:23am UTC

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