I would have liked to have automated several extraction except that when I run the macro I have pop-up windows that annoy me terribly I can make them disappear by pressing enter.
Public Sub RunGUIScript()
Dim W_Ret As Boolean
Dim Société As String
Sheets("Extraction").Select
Société = Range("b9")
Application.SendKeys "{Enter}"
' Connect to SAP
W_Ret = Attach_Session
If Not W_Ret Then
Exit Sub
End If
On Error GoTo myerr
objSess.findById("wnd[0]").maximize
objSess.findById("wnd[0]/tbar[0]/okcd").Text = "S_ALR_87012039"
objSess.findById("wnd[0]/tbar[0]/btn[0]").press
objSess.findById("wnd[0]/usr/radSUMMB").Select
objSess.findById("wnd[0]/usr/chkP_GRID").Selected = True
[...]
Exit Sub
myerr:
MsgBox "Error occured while retrieving data", vbCritical + vbOKOnly
End Sub
The "Application.SendKeys "{Enter}" feature does not make my SAP windows disappear so it is not the solution that works