How to pass array as a input argument to the macro in uipath

Hi all,
I have an array which is having filenames in a folder.
I want to call a macro from uipath and need to pass the above array as input parameter to it.
Pls help on this.
Thanks in advance.

Are you talking about Word/Excel macros?
What methods have you tried so far?

Excel macros only.
Under excel application scope activity…I have used execute macro activity to call or execute macro.

Afaik, there’s no way to pass a array to the vba code and have it treated as 1 single argument. The “Execute Macro” activity treats the array as a list of arguments to feed vba.

Possible bypass:
step 1) write the value of the array’s items with “write cell”/“write range” into the excel file
step 2) write a “proxy” vba that reads the value into array/variant and then calls the desired sub/function

Hi, @dschiranjeevi
I just found a way to do it, see the image below.

*Create an array of your desired type as follow:
new string(){"Example","Example2"} in UIPATH

and set your Macro with an array parameter.
Sub Example(valueCallType() As String)
MsgBox (valueCallType(1))
End Sub

Best Regards.

1 Like

Hi all,

For the word , you have the solution here.