Sub
complete_process()
Dim
SapGuiAuto
As
Object
Dim
SAPApp
As
Object
Dim
SAPCon
As
Object
Dim
session
As
Object
Set
SapGuiAuto = GetObject(
"SAPGUI"
)
Set
SAPApp = SapGuiAuto.GetScriptingEngine
Set
SAPCon = SAPApp.Children(0)
Set
session = SAPCon.Children.ElementAt(0)
session.findById(
"wnd[0]"
).maximize
session.findById(
"wnd[0]/usr/cntlIMAGE_CONTAINER/shellcont/shell/shellcont[0]/shell"
).selectedNode =
"F00182"
session.findById(
"wnd[0]/usr/cntlIMAGE_CONTAINER/shellcont/shell/shellcont[0]/shell"
).doubleClickNode
"F00182"
session.findById(
"wnd[0]/tbar[1]/btn[17]"
).press
session.findById(
"wnd[1]/tbar[0]/btn[8]"
).press
session.findById(
"wnd[1]/usr/cntlALV_CONTAINER_1/shellcont/shell"
).currentCellRow = 1
session.findById(
"wnd[1]/usr/cntlALV_CONTAINER_1/shellcont/shell"
).selectedRows =
"1"
session.findById(
"wnd[1]/usr/cntlALV_CONTAINER_1/shellcont/shell"
).doubleClickCurrentCell
session.findById(
"wnd[0]/tbar[1]/btn[8]"
).press
session.findById(
"wnd[1]/tbar[0]/btn[0]"
).press
session.findById(
"wnd[0]/usr/cntlGRID1/shellcont/shell/shellcont[1]/shell"
).setCurrentCell 8,
"TEXT"
session.findById(
"wnd[0]/usr/cntlGRID1/shellcont/shell/shellcont[1]/shell"
).selectedRows =
"8"
session.findById(
"wnd[0]/usr/cntlGRID1/shellcont/shell/shellcont[1]/shell"
).contextMenu
session.findById(
"wnd[0]/usr/cntlGRID1/shellcont/shell/shellcont[1]/shell"
).selectContextMenuItem
"&XXL"
session.findById(
"wnd[1]/tbar[0]/btn[0]"
).press
session.findById(
"wnd[1]/usr/ctxtDY_PATH"
).SetFocus
session.findById(
"wnd[1]/usr/ctxtDY_PATH"
).caretPosition = 8
session.findById(
"wnd[1]"
).sendVKey 4
session.findById(
"wnd[2]/usr/ctxtDY_PATH"
).Text =
"T:\\Pfad1"
session.findById(
"wnd[2]"
).sendVKey 4
session.findById(
"wnd[3]/usr/ctxtDY_FILENAME"
).Text =
"Export-File.XLSX"
session.findById(
"wnd[3]/usr/ctxtDY_FILENAME"
).caretPosition = 38
session.findById(
"wnd[3]/tbar[0]/btn[11]"
).press
session.findById(
"wnd[2]"
).Close
session.findById(
"wnd[1]/usr/ctxtDY_FILENAME"
).SetFocus
session.findById(
"wnd[1]/usr/ctxtDY_FILENAME"
).caretPosition = 43
session.findById(
"wnd[1]/tbar[0]/btn[11]"
).press
End
Sub