Skip to Content
author's profile photo Former Member
Former Member

Excel VBA (SAP.Functions) Not working with SAP GUI 7.40

have a Excel VBA which connects to SAP, pulls some data and does some processing on it. It was working fine with SAP GUI 7.20. But it stopped working when I installed SAP GUI 7.40. My code is as below :

Dim obBAPICall As Object  ' * Create object Set obBAPICall = CreateObject("SAP.Functions") . .

I get following error :

I've already gone through some weblinks and I believe I've all the required references. (In fact, I've added many more in order to troubleshoot the problem).

My SAP GUI version is :

For your information -

Following code does not have any problem :

Set SAPguiApp = CreateObject("Sapgui.ScriptingCtrl.1")

Any help is highly appreciated.

Thank you.

1.png (23.6 kB)
3.png (10.4 kB)
2.png (50.9 kB)
Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Jul 28, 2016 at 10:26 PM

    Okay, the problem is solved. The issue was w.r.t. MS Office version. I restored the MS Office the VBA works fine. The issue was because of some roll out of the MS Office updates by IT admin folks.

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jul 28, 2016 at 09:05 PM

    I have a similar issue, having also just updated from 7.20 to 7.40, my script will no longer connect Excel to SAP. The basic part of the script is:

    Sub SAP_Connect_basic()

    If Not IsObject(SAPguiApp) Then

    Set SAPguiApp = CreateObject("Sapgui.ScriptingCtrl.1")

    End If

    If Not IsObject(Connection) Then

    Set Connection = SAPguiApp.OpenConnection("<text string in Logon pad describing the connection>", True)

    End If

    If Not IsObject(Session) Then

    Set Session = Connection.Children(0)

    End If

    End Sub

    If you run the script once, you get popup from MS Visual Basic:

    Run-time error '1000':

    SAP Logon connection entry not found.

    If you terminate it and run it a second time, you get a new error:

    Run-time error '601':

    Sapgui cannot be initialized.

    I can modify the script slightly so that it will run as long as SAP is already open, but I need the script to be able to open SAP automatically (which it did prior to the update with no issue).

    We're on file version 7400.2.7.1112, build 1635946, patch level 7.

    Any help woud be fantastic.


    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.