You can not hide the RPA software code. But, as you suggested, you can run the macros on your server, this way the code is 100% hidden.
To do so, make a website the user clicks a button, and then this triggers the macro to run on your server via the command line API.
If you use XClick, note that this RPA command requires an unlocked desktop. But this is a not a big issue, just something to be aware of.