Skip to Content

Turn off message "Script is trying to connect to SAPGui"

Hi again everyone.

I have small simple question.

When I connect through Excel VBA to sap:

Dim App, Connection, session As Object

Set sapguiauto = GetObject("SAPGUI")

Set App = sapguiauto.GetScriptingEngine

Set Connection = App.Children(0)

Set session = Connection.Children(0)


The message, see attachement, pops up - you just have to click ok or press enter. I tried Sendkeys and application.displayalerts but neither of it works.

Is there a way, how to jump it over/ skip it/ press the OK button via script.

BTW: when I had older version of SAP - pre 7 version I think, It worked without note.

Thanks for your advices.

SAP.png (184.5 kB)
Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

1 Answer

  • Best Answer
    Mar 10, 2014 at 11:10 PM

    Ahoj Miroslav,

    this issue is so old as the SAP GUI Scripting. You can try the following:

    SAP GUI -> Alt / F12 (local layout tune) -> Options -> Scripting:

    - Notify when a script connects to SAP GUI -> deactivate

    - Notify when a script establishes a connection -> deactivate

    Regards ScriptMan

    Add comment
    10|10000 characters needed characters exceeded