Skip to Content
0

VBA BEX Automation - Error Code 438 in SAPBEXinitConnection

Jun 09, 2017 at 05:42 PM

406

avatar image
Former Member

I am using the following auto login script from SAP using Example 1.

https://wiki.scn.sap.com/wiki/display/BI/Using+VBA+to+connect+to+BW+server+with+SAPBEXgetConnection

Function LogonToServer() As Boolean
   LogonToServer = False
   Dim myConnection As Object
   Set myConnection = Run("BExAnalyzer.xla!SAPBEXgetConnection")
   With myConnection
      .client = "000"
      .user = "myUserName"
      .Password = "myPassword"
      .Language = "EN"
      .systemnumber = 45
      .system = "XXX"
      .ApplicationServer = "ab1234.wdf.sap.corp"
      .SAProuter = ""
      .logon 0, True
   End With
   If myConnection.IsConnected <> 1 Then
      'launch the Logon Dialog for manual connection
      myConnection.logon 0, False
         If myConnection.IsConnected <> 1 Then
            MsgBox "something went wrong ..."
            Exit Function
         End If
   End If
   If myConnection.IsConnected = 1 Then
      LogonToServer = True
   End If
   Run "BExAnalyzer.xla!SAPBEXinitConnection"
End Function

I get an 438 error on

Call pAddin.ExcelInterface.SetConnectionFromHandle(p_connectionObj)

line below.  Any suggestions to fix?
Public Function initConnection() As Boolean
  initConnection = False
  If isConnected Then
    With p_connectionObj
    End With
    If pAddin Is Nothing Then Call SetStart
    If pAddin Is Nothing Then
      initConnection = False
      Exit Function
    End If
    Call pAddin.ExcelInterface.SetConnectionFromHandle(p_connectionObj)
    If Len(pWbid) > 1 Then
      Call pAddin.ExcelInterface.runWorkbook(pWbid)
    Else
      If Len(pQueryid) > 1 Then
        Call pAddin.ExcelInterface.runQuery(pQueryid)
      End If
    End If
  End If
  initConnection = isConnected
End Function
10 |10000 characters needed characters left characters exceeded
Former Member

I am using BI Addon ver 7.4 support package 8

0
* Please Login or Register to Answer, Follow or Comment.

3 Answers

avatar image
Former Member Mar 26 at 10:54 AM
0

Hi,

I have the same problem... Is there a solution?

Thanks

Marina

Share
10 |10000 characters needed characters left characters exceeded
avatar image
Former Member Apr 08 at 05:34 AM
0

Hello,

i have the same issue, did you get any solution for this,

thans
ahmed

Share
10 |10000 characters needed characters left characters exceeded
Eugeniy LANCEV Apr 06 at 08:10 AM
0

Check note 2541995 - BEx Analyzer: Using VBA to connect to BW server with SAPBEXgetConnection

Share
10 |10000 characters needed characters left characters exceeded