Hi,
I have this macro that work and tell me that i sucessfuly log on in SAP.
Dim sapConn As Object 'Declare connection object 'added Set objshell = CreateObject("WScript.Shell") Set objapp = objshell.Exec(Environ("PROGRAMFILES") & "\SAP\FrontEnd\SAPgui\saplogon.exe") Set sapConn = CreateObject("SAP.Functions") 'Create ActiveX object 'Specify user sapConn.Connection.User = "Flie" 'Then password sapConn.Connection.Password = "Mz123" 'Client sapConn.Connection.Client = "100" 'added sapConn.Connection.System = "PVE" 'Target server address sapConn.Connection.ApplicationServer = "10.169.555.233" 'Language code sapConn.Connection.Language = "EN" If sapConn.Connection.Logon(0, True) <> True Then MsgBox "Cannot Log on to SAP" 'Issue message if cannot logon Else MsgBox "Logged on to SAP!" End If
When it open SAP...I still need to click logon and input my password and user name..
any clue? It seem there is no conenction between the two