cancel
Showing results for 
Search instead for 
Did you mean: 

Need help writing VBA code that talks to excel

Former Member
0 Kudos

Good afternoon Everyone,

I have been trying to use the following code through excel to talk to SAP, however I keep getting a "automation error, invalid syntax" error code.

Public Sub SimpleSAP()

Set SapGuiAuto = GetObject("SAPGUI") 'Get the SAP GUI Scripting object
Set SAPApp = SapGuiAuto.GetScriptingEngine 'Get the currently running SAP GUI
Set SAPCon = SAPApp.Children(0) 'Get the first system that is currently connected
Set session = SAPCon.Children(0) 'Get the first session (window) on that connection

end sub
jyothirmayee_s
Active Contributor
0 Kudos

Accepted Solutions (0)

Answers (0)