I need to connect to SAPGUI where it piggy backs off of an already existing SAP connection.(like it would in VBA) Due to my companies IT policies I am not allowed to connect directly to SAP using username and password. Your help would be much appreciated. The code below is what i used in VBA
Dim App, Connection, session As Object
Set SapGuiAuto = GetObject("SAPGUI")
Set App = SapGuiAuto.GetScriptingEngine
Set Connection = App.Children(0)
Set session = Connection.Children(0)