Skip to Content

Accept script message in SAP just once

Experts please I need help with this.

I have developed a code vba (Excel) that interacts directly with SAP, and it works perefectly, however its a code that takes a lot of time it works with several transaction in diferent subs, and its only problem is that the user must press a Yes button every time excel must interact with SAP (every time it calls a sub)  to obtain data, and I was wondering if there is a way that I can declare the the opening code to interact with sap GLOBALY:

If Not IsObject(App1) Then

   Set SapGuiAuto = GetObject("SAPGUI")

   Set App1 = SapGuiAuto.GetScriptingEngine

End If

If Not IsObject(Connection) Then

   Set Connection = App1.Children(0)

End If

If Not IsObject(session) Then

   Set session = Connection.Children(0)

End If

If IsObject(WScript) Then

   WScript.ConnectObject session, "on"

   WScript.ConnectObject Application, "on"

End If

I mean for every sub that i have in vba.

Thanks in advance.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Best Answer
    Jul 02, 2014 at 09:22 PM

    Hello.

    When you untick below checkboxes SAPGUI will never ask again to allow scripts:

    Hope this solve your issue. Cheers, Holger

    Add comment
    10|10000 characters needed characters exceeded

  • Jul 03, 2014 at 12:28 PM

    THANKS HOLGER! thats exactly what I needed!

    Add comment
    10|10000 characters needed characters exceeded