Hi. I'm trying to connect to SAP Logon with VBA but I'm getting the error 429: The ActiveX component can not create the object.
In this point 429 error:
VBA Code:
I install this module
Under Tools | References in the VBA Editor menu, scroll to you find the SAP objects
****** id="cke_pastebin" style="position: absolute; top: 664px; width: 1px; height: 1px; overflow: hidden; left: -1000px;">Could they help where the mistake might be? I need to connect the sap</body>
In this point 429 error:
Code:
Set oBapiCtrl = CreateObject ("sap.bapi.1")
Set oBapiLogon = CreateObject ("sap.logoncontrol.1")
VBA Code:
Code:
Sub sap()
Dim oBook As Workbook
Dim oShee As Workbook
Dim oBapiCtrl As Object
Dim oBapiLogon As Object
Dim oSalesOrder As Object
Dim oCustumer As Object
Dim oProduct As Object
Dim oItem As Object
Dim oIndex As Integer
Set oBook = Application.ActiveWorkbook
Set oSheet = oBook.Worksheets(1)
Set oBapiCtrl = CreateObject("sap.bapi.1")
Set oBapiLogon = CreateObject("sap.logoncontrol.1")
oBapiCtrl.Connection = oBapiLogon.NewConnection
oBapiCtrl.Connection.ApplicationServer = "000.000.000.000" 'I put my correct IP
oBapiCtrl.Connection.System = "000"
oBapiCtrl.Connection.Client = "000"
oBapiCtrl.Connection.User = "Jonas"
oBapiCtrl.Connection.Password = "MyPassword"
oBapiCtrl.Connection.Language = "PT"
oBapiCtrl.Connection.SystemNumber = "00"
If oBapiCtrl.Connection.Logon(0, True) <> True Then
MsgBox "Not connect", vbInformation, "Sap Logon"
Exit Sub
End If
End Sub
I install this module
Under Tools | References in the VBA Editor menu, scroll to you find the SAP objects
- Select SAP Data Provider (sapdattap.ocx)
- Select SAPGUIRessources (sapguirm.ocx)
****** id="cke_pastebin" style="position: absolute; top: 664px; width: 1px; height: 1px; overflow: hidden; left: -1000px;">Could they help where the mistake might be? I need to connect the sap</body>