UIPath Invoke VBScript

Hello @Johann,

in my opinion it is not necessary to transfer the GUISession object to the VBScript directly. You know the session object in your calling program. With the property ID you can get the full ID of the session as string, e.g. like this:

/app/con[0]/ses[1]

Dismantle this string to get the connection number, in this example 0, and the session number, in this example 1. Now you can transfer this numbers to your VBScript and use it like I described here.

A tiny hint: It is not possible to use one SAP session parallel with two or more different SAP GUI Scripting calls. Be sure, before you execute a new SAP GUI Scripting call, that the previous one has ended. Or better is to use the Busy property from the session object.

Best regards
Stefan

3 Likes