avatar image
Former Member

Need help writing VBA code that talks to excel

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
Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

0 Answers

Skip to Content