We have added search box. Key in SAP issue keyword to search
TopBottom

Announcement: wanna exchange links? contact me at sapchatroom@gmail.com.

[sap-other] Macro Cannot Connect to SAP GUI. Error in Loading DLL

Posted by Admin at
Share this post:
Ma.gnolia DiggIt! Del.icio.us Yahoo Furl Technorati Reddit

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.
 
__.____._
Manage Settings | Unsubscribe | Create FAQ | Send Feedback
  
© 2017 Ziff Davis, LLC. and message author.
Ziff Davis, LLC. 28 E 28th Street New York, NY 10016
Alu12161  
 
View this online
Ask a new question
 
In the Spotlight
Have a technical question? Need to find IT solutions? Ask your peers in the Toolbox for IT community.

_.____.__

0 comments:

Post a Comment

T r a n s l a t e to your language