Excel Macro Output: How to send an output to UiPath?

When I run Execute Macro, how do I set an output in my macro to be retrieved by UiPath in Macro Output?

1 Like

Define the macro as a function in VBA and assign the output value to the name of the function. This value will be returned to UiPath Macro Output variable

Private Function Macro1() As String
' Macro1 Macro'

    Dim Var1 As String
    Var1 = ActiveCell.Value

    Macro1 = Var1
End Function

Macro1 is the function name and also the return value

1 Like