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.