on 04-23-2014 8:40 PM
I am trying to login in to SAP using VBA code but the code fails as indicated below .
In Function GetBEx(Optional iWb As Workbook) As Object
GetBEx = pAddin.ExcelInterface.WorkbookBExExcelApplication(lName)
Works properly – I get an object
However, in the sapBEXgetConnection function it seems that the lBex.ComConnection fails. The p_connectionObj doesn’t get assigned (p_connectionObj is Nothing)
Function sapBEXgetConnection(Optional IWhat As Integer) As Variant
If IWhat = 0 Then
' try to get BexApi Connection
Dim lBEx As Object
Set lBEx = GetBEx
On Error Resume Next
Set p_connectionObj = lBEx.ComConnection 'fails here
If Err.Number <> 0 Then Set p_connectionObj = Nothing
On Error GoTo 0
If p_connectionObj Is Nothing Then If Not prepareConnection Then Exit Function
Set sapBEXgetConnection = p_connectionObj
End If
End Function
All of this code is part of the Bexanalyzer Excel Add-In
I’m assuming that I’m missing a patch or some configuration is incorrect but, since I’m not very familiar with SAP I don’t know. Any help would be greatly appreciated. Thank you.
Hi Paul,
Please do search SAP Service market place for relevant OSS note. It can happen because of incompatibility between SAP version and the Microsoft Excel versions, so please do check whether your versions are at the expected levels. Take help from your technical/basis team to get the BEx patches uninstalled and install again. These approaches should fix your issue.
Best Regards,
Chandrasekhar R Kalluru
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Paul,
I do not have a solution to your problem but am curious to know what you're trying to achieve here. Are you trying to emulate an SSO automatic connection via VBA?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Sebastien,
Since I don't know what an SSO automatic connection is I can't give you an answer. Can you explain it?
Here's what I'm trying to achieve: on demand I'd like to execute VBA code that will use Bexanalyzer.xla functions to log in and then refresh a query that exists in the Excel workbook. Ultimately I'll want to apply parameters / variables to the query when it is refreshed. I may then automatically execute VBA code to manipulate the resulting data in the workbook. Basically I want to be able to do all of this without any user input.
Paul
Why do you need to run a report in the front-end without any user input? If you're using VBA code, you'll still need to run it on a machine so who will look at the results???
If you need to send the results of that report or fill the OLAP cache for the query, use the BEx BroadCaster instead. For Workbooks, you'll need to use a precalculation server.
Sebastien
User | Count |
---|---|
87 | |
10 | |
10 | |
9 | |
7 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.