Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Connect SAP using EXCEl on win 97

Former Member
0 Likes
628

Dear gurus

i have made a bapi and im calling it from EXCEL.

below is the connection code.

Public Const CNT_STR_USR As String = "ABAP"
Public Const CNT_STR_PWD As String = "******"
Public Const CNT_STR_APPLN_SRVR As String = "***.***.**.**"
Public Const CNT_STR_SYSTEM As String = "R3P"
Public Const CNT_STR_SYS_NUM As String = "00"
Public Const CNT_STR_CLIENT As String = "800"
Public Const CNT_STR_LOGON_LANG As String = "EN"
Public Const CNT_STR_ROUTER As String = "/H/***.***.***.***/H/"
Public Const CNT_STR_LOG_FILE As String = "C:\Store_Activities.txt"
Public Const CNT_INT_LOG_LEVEL As Integer = 9

Sub button1_click()
Dim objCompanyCodes As Object

Set obSAPFnCntrl = CreateObject("SAP.Functions")
Set obSAPConn = obSAPFnCntrl.Connection

' Log the overall activity
obSAPFnCntrl.LogLevel = CNT_INT_LOG_LEVEL
obSAPFnCntrl.LogFileName = CNT_STR_LOG_FILE

 
'Set the properties for the connection control

With obSAPConn

.ApplicationServer = CNT_STR_APPLN_SRVR
.SystemNumber = CNT_STR_SYS_NUM
.Destination = "R3D"
.User = CNT_STR_USR
.Password = CNT_STR_PWD
.Language = CNT_STR_LOGON_LANG
.HostName = CNT_STR_APPLN_SRVR
.Client = CNT_STR_CLIENT
'.SAPRouter = CNT_STR_ROUTER

End With

'Logon to SAP in silent mode
If obSAPConn.Logon(0, True) = False Then
    MsgBox "R/3 connection failed"
    Exit Sub
End If

This code is working fine in windows XP under MSOFFICE 2007 but when i try to use on Win97 under office 97 i get this error

ACTIVEX CAN'T CREATE OBJECT

How to resolve this ?

Regards

Saad Nisar

Dear gurus

i have made a bapi and im calling it from EXCEL.

below is the connection code.

Public Const CNT_STR_USR As String = "ABAP"
Public Const CNT_STR_PWD As String = "******"
Public Const CNT_STR_APPLN_SRVR As String = "***.***.**.**"
Public Const CNT_STR_SYSTEM As String = "R3P"
Public Const CNT_STR_SYS_NUM As String = "00"
Public Const CNT_STR_CLIENT As String = "800"
Public Const CNT_STR_LOGON_LANG As String = "EN"
Public Const CNT_STR_ROUTER As String = "/H/***.***.***.***/H/"
Public Const CNT_STR_LOG_FILE As String = "C:\Store_Activities.txt"
Public Const CNT_INT_LOG_LEVEL As Integer = 9

Sub button1_click()
Dim objCompanyCodes As Object

Set obSAPFnCntrl = CreateObject("SAP.Functions")
Set obSAPConn = obSAPFnCntrl.Connection

' Log the overall activity
obSAPFnCntrl.LogLevel = CNT_INT_LOG_LEVEL
obSAPFnCntrl.LogFileName = CNT_STR_LOG_FILE

 
'Set the properties for the connection control

With obSAPConn

.ApplicationServer = CNT_STR_APPLN_SRVR
.SystemNumber = CNT_STR_SYS_NUM
.Destination = "R3D"
.User = CNT_STR_USR
.Password = CNT_STR_PWD
.Language = CNT_STR_LOGON_LANG
.HostName = CNT_STR_APPLN_SRVR
.Client = CNT_STR_CLIENT
'.SAPRouter = CNT_STR_ROUTER

End With

'Logon to SAP in silent mode
If obSAPConn.Logon(0, True) = False Then
    MsgBox "R/3 connection failed"
    Exit Sub
End If

This code is working fine in windows XP under MSOFFICE 2007 but when i try to use on Win97 under office 97 i get this error

ACTIVEX CAN'T CREATE OBJECT

How to resolve this ?

Regards

Saad Nisar

2 REPLIES 2
Read only

Sandra_Rossi
Active Contributor
0 Likes
562

what SAPGUI did you install on your PC?

Read only

0 Likes
562

7