The business is providing an excel with an in built macro say A.
The macro contains one path that is dynamic.
I am planning to pass an arugument and use execute macro.
Please let me know how to achieve ?
I am also open to any alternate solutions.
I want to see the code.
The macro code where we are taking the argument as input
you should have like this
Sub Macro_Name(FilePath As String)
Inside can use the FilePath just as variable
End Sub
cheers
To pass an argument to a macro in UiPath, you can use the Execute macro
activity. The Execute macro
activity allows you to execute macros that are stored in Excel files.
To use the Execute macro
activity, you will need to:
- Add the
Execute macro
activity to your workflow. - In the
Macro file
property, specify the path to the Excel file that contains the macro. - In the
Macro name
property, specify the name of the macro. - In the
Arguments
property, specify the arguments that you want to pass to the macro.
Check this out to know on how to pass parameters to macro
Cheers @Ritaman_Baral
There is one more scenarion.
The macro A has a dynamic path .
The bot needs to edit the macro in the excel itself.
how to do that ?
Well u can use excel application scope and use execute macro within that
Have a view in this thread with similar scenario and git resolved
Hope this helps
Cheers @Ritaman_Baral
Thanks.
The catch is I dont need to run the macro.
The bot needs to edit the path in the macro.
The business has provided the macro.
The macro has a path which needs to be edited
They provided the code in the Notepad file, open that notepad file and pass the argument as @Anil_G said in the vb code.
Hope it helps!!
Click on Developer->VisualBasic
In that you can find the Macro Code
Hope you understand!!
The excel is having in-built macro.
The built in macro also can be edited …or you cna ask business to add the path argument
cheers
In that case…
The path will only be edited right ?
I dont want to run the macro…
What you want to do with macro after editing?
can you please tell that
one alternative is give the input argument and when someone else is running he/she would get a prompt
cheers
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.