on 2021 Jun 08 5:42 PM
Hello-
My question: How can I script the right-click action on the SAPGUI logon pad?
My code is here:
Dim Applic
Dim Connection
Dim Session
Dim WSHShell
Shell "C:\Program Files (x86)\SAP\FrontEnd\SAPgui\saplogon.exe", vbNormalFocus
Set WSHShell = CreateObject("WScript.Shell")
Do Until WSHShell.AppActivate("SAP Logon ")
DoEvents
Application.Wait Now + TimeValue("0:00:01")
Loop
Set WSHShell = Nothing
Set SapGui = GetObject("SAPGUI")
Set Applic = SapGui.GetScriptingEngine
Set Connection = Applic.OpenConnection("PAG - North American AG Production (006)", True)
Set Session = Connection.Children(0)
Request clarification before answering.
Hi Grace,
many years ago I solved a similar requirement with a workaround, which I will present here now:
Dim Applic
Dim Connection
Dim Session
Dim WSHShell
Shell "C:\Program Files (x86)\SAP\FrontEnd\SAPgui\saplogon.exe", vbNormalFocus
Set WSHShell = CreateObject("WScript.Shell")
Do Until WSHShell.AppActivate("SAP Logon ")
DoEvents
Application.Wait Now + TimeValue("0:00:01")
Loop
WSHShell.sendkeys "^{HOME}"
Application.Wait Now + TimeValue("0:00:01")
WSHShell.sendkeys "+{ENTER}"
Application.Wait Now + TimeValue("0:00:04")
Set WSHShell = Nothing
Set SapGui = GetObject("SAPGUI")
Set Applic = SapGui.GetScriptingEngine
'Set Connection = Applic.OpenConnection("PAG - North American AG Production (006)", True)
Set connection = Applic.Children(0)
Set Session = Connection.Children(0)
Regards, ScriptMan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
63 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 | |
4 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.