I saved my script and connected it to VBA, then I want to copy my local SAP GUI data into an external Excel file.
Sub FOS()
If Not IsObject(App) Then
Set SapGuiAuto = GetObject("SAPGUI")
Set App = SapGuiAuto.GetScriptingEngine
End If
...
session.findById("wnd[0]").maximize
session.findById("wnd[0]/tbar[0]/okcd").Text = "S_ALR_87011964"
...
session.findById("wnd[0]/tbar[1]/btn[19]").press
session.findById("wnd[0]/usr/chkPA_XGBAF").Selected = True
session.findById("wnd[0]/usr/chkPA_XGBAF").SetFocus
session.findById("wnd[0]/tbar[1]/btn[8]").press
End Sub()
I want to automate an extraction and thus copy my data and transfer them to a very specific Excel file thanks to a VBA macro.