Excel VBA Utility



Hi guys,

Something we discussed the other day was better interaction with VBA - e.g. you can write a snippet of VBA code and “send” it to Excel rather than embedding it into the worksheet. Therefore you would utilise the capabilities of VBA but control it from UiPath. Obviously you would have to have to maintain control over this as we know people love to go nuts with VBA :smile:

Could this be included within the new “WriteCode” activity? What do others think?



That would be really useful and enable a lot more people to contribute.

How I’d see it though, is not part of WriteCode activity, but something more like InjectJsScript. Some parts could be common (editor maybe?), but since the purpose is different (run code externally vs internally) I’d keep it separate.

One thing to overcome is the usual default limitations for running code in Excel, but that shouldn’t be too hard.



We already implemented “Invoke Code” activity which will allow to insert snippets of VB.Net
Now it is in pull request phase and hopefully we’ll have it soon for you guys to experiment with it.



Code activity should go with code activity:

This is Excel VBA Activity - ability to write Macros in UiPath and execute them against an Excel file. This one is more complicated to achieve. At least I don’t see a way for enabling autocomplete and security issues may appear; so more difficult to implement.


I think that with invoke code it will be possible to write VB.Net code that automates Excel



Is it? Even if it is I think this should go as a separate VBA activity.


I never actually tried it but i’m quite confident that it should work. It might get quite complex though



I don’t like complex. I’m not clever enough :stuck_out_tongue:


neither do I :slight_smile:


So now we have Invoke VBA (apparently since Decembe!! - it’s amazing! :slight_smile: )

Thanks @productEnt