Hello.
I am having an error of using execute macro activity.
Although the macro itself works well, an error comes out when I use to execute macro from uipath.
Please Help me.
Thank you…
Hi @hsupyaewoon
Could you please share the error message or your workflow that error occurred.
1.Please check your Trust Center.
2.Please check your macro code have something like workbook.close or wb.close
(command for close your workbook), try to comment out or remove it.
Please refer as below:
I hope this information will be useful for you
@Natapong
Thank you for your answer.
For the suggestion 1, I checked disable all macros with notification for security.
For no 2, i don’t really understand what it means… :"(
I have only one macro and i saw nothing similar like wb.close() or excel.quit().
If your marco code don’t have command to close workbook that it ok.
Please try to check Enable all macros for test run excute macro activity.
I want to confirm the macro settings, is it a cause of your problem?
Hi @hsupyaewoon
Please try to run your workflow by Debug mode and set breakpoint on your Execute marco activity.
After workflow stop at breakpoint, please try to run your macro by click run marco in your Excel.
*I want to confirm your marco can run correctly after Append Range ?
Hello @Natapong
I did it.
The macro runs correctly after Append Range.
I ran it by clicking the button in my excel.
But I am not sure what do you mean by to set breakpoint.
I just deleted the execute macro activity for a while.
->set breakpoint for stop workflow and test run marco.
It same with deleted the execute macro activity and run marco after run workflow finished
I would like to test run your marco code by using Invoke VBA activity.
1.Copy your marco code and paste it to Text editor(notepad etc)
2.Save it to .vbs file
3.Put Invoke VBA activity to your workflow (inside Excel application scope)
4.Try to run workflow
For emergency solution, Please try to use click activity to click run macro on your excel file.
Click Develiper tab > Click Macros menu > Click Run button
*Don’t forget to use wildcard in your selector.
@lakshman , @Palaniyappan , @Lahiru.Fernando and everybody
Could you please help me to find solution for this error.
When hsupyaewoon run Execute Macro activity, system show error message
If run Marco by click run on Excel file,then it working well.
Hi , is the Macro name correct ?
“Main” is the default name for Macro
Are you using the same name for creating the macro ?
Hello @Natapong
Thank you so much for your reply.
And really sorry for being late.
I have tried “invoke macro” and this error came out.
Really appreciate for your help.
Thank you so much…
Hello @vinay_reddy
Thank you for your reply.
I used different name in macro.
Do I need to use the default name?
Hi @hsupyaewoon
Please try to checked [Enable all macros] and [Trust access to the VBA project] and run your workflow again.