Skip to Content
0

SAP Bex Automation - Unattended logon issue

Dec 01, 2017 at 12:21 AM

52

avatar image
Former Member

Hi,

I'm trying to run BW reports within Excel using VBA completely unattended. So far it almost works but I get stuck with a very last click on the OK button of the window shown below. If i manually click the OK button the script execute without any problem.

After looking around for days I unfortunately was unable to figure this last little bit by myself and would quite welcome any help...

Code sample below. Note that I believe I do not need to specify any other parameters since my connection is already pre-configured on my system. That said, I did try to specify each individual parameters like many examples I found with the same exact results. Also note I deliberately left out the error management piece so the code is lighter to post here.

Private Function ConnectToBW() As Boolean
    ConnectToBW = False
    Set MyConnection = Run("SAPBEX.XLA!SAPBEXgetConnection")
    MyConnection.System = "WP1 - BW 3.5 xxxxxxxxxxxxxxxxxxxxxxxxxx"
    MyConnection.usesaplogonini = False
    MyConnection.logon 0, True
    If MyConnection.IsConnected <> 1 Then
        MyConnection.logon 0, False
        If MyConnection.IsConnected <> 1 Then
            MsgBox "Attempt failed!"
            Exit Function
        End If
    End If
    Run "sapbex.xla!sapbexinitConnection"
    ConnectToBW = True
End Function

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

avatar image
Former Member Dec 15, 2017 at 07:22 PM
0

Ok, looks like this subject does not raise the interest I was hoping...

I ended-up working around the issue using AutoIt Library which detects the window and clicks the button for me. Not pretty and I would still largely prefer a solution using the native SAP Library...

Share
10 |10000 characters needed characters left characters exceeded