How to pass a List as parameter for Invoke VBA code Activity

I have initialized my Item(list) = new List(of string) and adding values with add collection activity.
Now I need to pass this list {Item(0),item(1),…item(n)} to VBA code. Can anyone help with parameters to pass in uipath activity “Invoke VBA” and parameters to receive at function level?

You can pass this to VBA, where && = some unique separator
eg if list = {“a”,“b”}, then this string will be a&&b
String.Join("&&",New List(Of String)({"a","b"}).ToArray)

In VBA split the string to list
Dim Result() As String
Result = Split(ListToString, "&&")

you can also encode and decode it using Json serializer

1 Like

Thank you ! That worked

1 Like

no problem, please mark my reply as solution :smiley:

1 Like

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