Announcement:
wanna exchange links? contact me at sapchatroom@gmail.com.
Posted by
Admin at
Question from Alu12161 on Oct 20 at 9:00 AM Hi everyone! Macro newb here, appreciate all for looking at my question. I've been trying to use a macro to connect to SAP GUI and log in as well. However I'm not sure if it is a reference I am missing or my code or what. Below is my code so far which pops up the SAP GUI application box. Afterwards the code breaks trying to connect to the system. Again, I don't know if I am writing the system name's wrong or missing a reference in the tool box. I checked every single SAP reference I have besides SAPLOGON because there is an "Error in loading DLL". Could that be why? And if it helps the system I am trying to connect to is Production in Client 100. Any help is largely appreciated! Sub SAP_OpenSessionFromLogon() Dim SapGui Dim Applic Dim connection Dim session Dim WSHShell Shell "C:\Program Files (x86)\SAP\FrontEnd\SAPgui\saplogon.exe", vbNormalFocus Set WSHShell = CreateObject("WScript.Shell") Do Until WSHShell.AppActivate("SAP Logon ") Application.Wait Now + TimeValue("0:00:01") Loop Set WSHShell = Nothing Set SapGui = GetObject("SAPGUI") Set Applic = SapGui.getscriptingengine Set connection = Applic.OpenConnection("systemexample", True) Set session = connection.Children(0) End Sub | Reply to this email to post your response. __.____._ | _.____.__ |