Grzegorz65
New Member
- Joined
- Apr 8, 2017
- Messages
- 3
Hello All
I am searching for macro script that opens new session when current session is running
Problem is that macro opens new sesion when its only opened but not makes new session when current session is running
exaple transaction after pressing execute button
My macro below
Thank you for help
Private Sub nextSession()
Dim nSessions As Integer
Set SapGuiAuto = GetObject("SAPGUI")
Set SAPApp = SapGuiAuto.GetScriptingEngine
Set sapCon = SAPApp.Children(0)
Set session = sapCon.Children(0)
nSessions = sapCon.Sessions.Count
session.CreateSession
Do
Application.Wait (Now() + 500 * ms)
If sapCon.Sessions.Count > nSessions Then Exit Do
Loop
Set sapSession = sapCon.Sessions.Item(CInt(sapCon.Sessions.Count - 1))
End Sub
I am searching for macro script that opens new session when current session is running
Problem is that macro opens new sesion when its only opened but not makes new session when current session is running
exaple transaction after pressing execute button
My macro below
Thank you for help
Private Sub nextSession()
Dim nSessions As Integer
Set SapGuiAuto = GetObject("SAPGUI")
Set SAPApp = SapGuiAuto.GetScriptingEngine
Set sapCon = SAPApp.Children(0)
Set session = sapCon.Children(0)
nSessions = sapCon.Sessions.Count
session.CreateSession
Do
Application.Wait (Now() + 500 * ms)
If sapCon.Sessions.Count > nSessions Then Exit Do
Loop
Set sapSession = sapCon.Sessions.Item(CInt(sapCon.Sessions.Count - 1))
End Sub