cancel
Showing results for 
Search instead for 
Did you mean: 

VBA and SAP multiply session

Former Member
0 Kudos

Hi all,

I'm trying to create multiply session parallel using VBA macro code and operate on them. Could you please support me ?

If Not IsObject(App) Then

   Set SapGuiAuto = GetObject("SAPGUI")

   Set App = SapGuiAuto.GetScriptingEngine

End If

If Not IsObject(Connection) Then

   Set Connection = App.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 App, "on"

End If

session.findById("wnd[0]").maximize

'session.findById("wnd[0]").Iconify

session.findById("wnd[0]/tbar[0]/okcd").Text = "KOB1"

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Solved:

I use session.ActiveWindow() and

SESSION_ = SESSION_ + 1

  Set session = Connection.Children(Int(SESSION_)) to change GIU connection

Answers (0)