Currently working in a virtual environment running UiPath 2014.10.4. We are developing an SAP process and wanted to incorporate SAP Visual Basic Scripts so that we can get a few pieces of information that are not available through the UiPath UI Explorer.
I am looking for a method to run SAP visual basic scripts without having to keep the script files in a folder. From what I researched online the only mentioned way of doing this is through building a custom activity in Visual Studio. This script created through SAP using the Script Recording and Playback option.
I looked into the guide here: https://docs.uipath.com/activities/docs/creating-a-custom-activity on how to create and import these custom activities however I cannot get the code to work as expected. I included the code I tested below ( I have near 0 experience is Visual Studio). I expect this code to read the status message and return to me not only the message but the type and it’s ID so that we can determine exceptions at a broader level.
Do you have any examples of how to get this working or the necessary steps needed so that we can create a package out of this and run it in UiPath?
Dim SapGuiAuto As Object
Dim session As Object
Dim Application As Object
Dim Connection As Object
SapGuiAuto = GetObject(“SAPGUI”)
Application = SapGuiAuto.GetScriptingEngine
Connection = Application.Children(0)
session = Connection.Children(0)
msgText = session.findById(“wnd/sbar”).Text
msgID = session.findById(“wnd/sbar”).MessageID
msgType = session.findById(“wnd/sbar”).MessageType