Quantcast
Channel: SCN : Discussion List - Scripting Languages
Viewing all articles
Browse latest Browse all 325

Connection to SAP from Excel

$
0
0

Hi Guys,

 

I am trying to connect to SAP from Excel. I have this bit of code in my macro:

 

Sub SAPConnect()

 

Dim sap

Set sap = CreateObject("SAP.Functions")

 

sap.Connection.User = "user"

sap.Connection.Password = "password"

sap.Connection.Client = "xxx"

sap.Connection.Systemnumber = "xx"

sap.Connection.System = "xxx"

sap.Connection.ApplicationServer = "xxxx"

sap.Connection.Language = "EN"

sap.Connection.GroupName = "xxxx"

sap.Connection.MessageServer = "xxxxxx"

 

Unfortunately I am not able to connect at all.

I get a run-time error "1001" Failed to return dispatch object right after Set sap = CreateObject("SAP.Functions")

I have searched the web a lot and most of the macros I could find use similar code for the connection.

This code used to work on SAP GUI 6.40 it stopped working as soon as my GUI was updated to 7.20.

Any ideas on how I need to modify the code?


Viewing all articles
Browse latest Browse all 325

Trending Articles