Execute macro - Macro doesn't work the same as executed manually


#1

Hi guys,

I’m having a problem with Execute macro activity. I’ve noticed that using this activity macro doesn’t behave exactly as it should when executed manually by me from the excel workbook. That causes problems with the macro output data, there are some problems with Evaluate method (generates an errors in cells where this method was used) as well as activating a specific worksheet after all macro activities - I’ve noticed that it doesn’t work (that specific worksheet is not activated after macro activities). Should I try to setup the UiPath workflow so that it runs the macro “manually”, without the use of execute macro activity ? Thanks for any help !


#2

I’ve seen that too. Treat the workbook as what they are, objects, so instead of refereing to sheet.name only , activate the workbook.

Sometimes if you look carefully UiPath opens two excel files, right, try to kill the process manually before running UiPath, log that error, and see how many times happens and if it is necesary to add a kill process activity.

I guess to run a macro for complex process saves a good amount of time.

regards.


#3

Hi razor34,

I am facing the same issue as you. Are you able to resolve the problem?
If so may I know the solution? Thanks In advanced.

Regards,
Eric


#4

can we have a sample xlsm and workflow?


#5

Hello,

Please follow below videos
https://www.youtube.com/results?search_query=execute+macro+in+uipath+by+karthik_bethi

Thanks,


#6

Running into the same error, the macro executes way faster with UiPath, in comparison to starting it manually. However, the results are completely different.
One part of the macro is to delete sheets, which are deleted after executing UiPath. This is why I thought everything is fine, but actually, the important sheets look different in comparison to a manual execution of the macro.


#7

Can you share a sample project?


#8

I solved the problem by a Click Image activity, as execute macro was not really working.
Thanks anyway for the response @Gabriel_Tatu


#9

have you tried with our latest package, we have two options of running macros?


#10

Yep, everything is updated to the latest version. I also used “execute macro” before and never had issues. I guess something inside the code was maybe giving UiPath some trouble.
Unfortunately, I can’t share the excel file.


#11

It started to work bad after the excel package upgrade?


#12

For workaround, you can go to manage package and rollback to previous version.


#13

Ah, that’s very good to know!!

Actually, I only tried it on the latest update not on the one before and now that I fixed it with click image, there is not really a need. But i will check on the Weekend if the older version runs better.


#14

Its important to know, and if this is the case maybe you can share a sample project so that we can investigate. You can remove any confidential data in the excel file.


#15

SIMILAR ISSUE:

I have a macro that is used to perform vlookup between 2 sheets in different workbooks. One workbook is created daily and other one is fixed (master). The macro works fine when run manually.
However, when UiPath bot creates one of the workbooks during the its run and macro is executed using Execute macro activity, the macro results are not sound.

Possible reasons and solutions?

TIA