How do i replace a value in macro with a variable and use that variable while running execute macro activity

Hi guys,

Below is the macro code:

Sub ClickAug()

’ ClickAug Macro

ActiveWorkbook.SlicerCaches(“Slicer_Month_name”).VisibleSlicerItemsList = Array _
( _

I need to replace month name , [Aug ] with a variable . and also I need to paas a value to this variable using execute macro activity.

Can anyone help me edit this code and also please let me know how do I pass variable to this macro.

Your help is greatly appreciated.


Welcome back to uipath community
We can mention a variable in macro
so if we are trying to pass variables in the parameters it can be done like this
{""+exampleVariable+""} in the MACROS PARAMETER Property
–if we are trying to values in the parameters in the property then like this
as per your scenario

and in the MACRO we need to mention the receiving argument with @ symbol before to the argument name like this

Cheers @poojakumari2793

1 Like

Hi I tried editing my code as below:

Sub checkvar()

Dim strMonth As String

’ checkvar Macro

ActiveWorkbook.SlicerCaches(“Slicer_Month_name”).VisibleSlicerItemsList = Array _
( _
End Sub

but it throws error:

Macro_Uipth%20snap Run_Macro_error