Buen dia,
Soy nueva en el uso del sistema SAP. Estoy tratando de automatizar la facturacion en SAP con datos extraidos de un Excel. Realice la grabacion del script pero cuadno trato de ejecutarlo me aparece el error: “Se requiere un objeto: ExcelSheet” me pudieran apoyar para saber que me esta faltando?
Esto es lo que tengo
If Not IsObject(application) Then
Set SapGuiAuto = GetObject("SAPGUI")
Set application = SapGuiAuto.GetScriptingEngine
End If
If Not IsObject(connection) Then
Set connection = application.Children(0)
End If
If Not IsObject(session) Then
Set session = connection.Children(0)
End If
If IsObject(WScript) Then
WScript.ConnectObject session, "on"
WScript.ConnectObject application, "on"
End If
session.findById("wnd[0]").resizeWorkingPane 120,31,false
session.findById("wnd[0]/usr/tabsTS/tabpMAIN/ssubPAGE:SAPLFDCB:0510/ctxtINVFO-ACCNT").text = ExcelSheet.cells (row,2).value
session.findById("wnd[0]/usr/tabsTS/tabpMAIN/ssubPAGE:SAPLFDCB:0510/ctxtINVFO-BLDAT").text = ExcelSheet.cells (row,4).value
session.findById("wnd[0]/usr/tabsTS/tabpMAIN/ssubPAGE:SAPLFDCB:0510/cmbINVFO-BLART").setFocus
session.findById("wnd[0]/usr/tabsTS/tabpMAIN/ssubPAGE:SAPLFDCB:0510/cmbINVFO-BLART").key = "FE"
session.findById("wnd[0]/usr/tabsTS/tabpMAIN/ssubPAGE:SAPLFDCB:0510/txtINVFO-WRBTR").text = ExcelSheet.cells (row,5).value
session.findById("wnd[0]/usr/tabsTS/tabpMAIN/ssubPAGE:SAPLFDCB:0510/chkINVFO-XMWST").setFocus
session.findById("wnd[0]/usr/tabsTS/tabpMAIN/ssubPAGE:SAPLFDCB:0510/chkINVFO-XMWST").selected = true
session.findById("wnd[0]/usr/tabsTS/tabpMAIN/ssubPAGE:SAPLFDCB:0510/cmbINVFO-MWSKZ").setFocus
session.findById("wnd[0]/usr/tabsTS/tabpMAIN/ssubPAGE:SAPLFDCB:0510/cmbINVFO-MWSKZ").key = "A2"
session.findById("wnd[0]/usr/tabsTS/tabpPAYM").select
session.findById("wnd[0]/usr/tabsTS/tabpPAYM/ssubPAGE:SAPLFDCB:0520/ctxtINVFO-ZTERM").text = "NT00"
session.findById("wnd[0]/usr/tabsTS/tabpPAYM/ssubPAGE:SAPLFDCB:0520/ctxtINVFO-ZLSCH").text = "T"
session.findById("wnd[0]/usr/tabsTS/tabpPAYM/ssubPAGE:SAPLFDCB:0520/ctxtINVFO-ZLSCH").setFocus
session.findById("wnd[0]/usr/tabsTS/tabpPAYM/ssubPAGE:SAPLFDCB:0520/ctxtINVFO-ZLSCH").caretPosition = 1
session.findById("wnd[0]").sendVKey 0
session.findById("wnd[0]").sendVKey 0
session.findById("wnd[0]/mbar/menu[3]/menu[2]").select
session.findById("wnd[1]/usr/tblSAPLFTXTTCTRL_TEXTE").verticalScrollbar.position = 3
session.findById("wnd[1]/usr/tblSAPLFTXTTCTRL_TEXTE/txtRTEXT-LTEXT[3,9]").text = ExcelSheet.cells (row,6).value
session.findById("wnd[1]/usr/tblSAPLFTXTTCTRL_TEXTE/txtRTEXT-LTEXT[3,9]").setFocus
session.findById("wnd[1]/usr/tblSAPLFTXTTCTRL_TEXTE/txtRTEXT-LTEXT[3,9]").caretPosition = 0
session.findById("wnd[1]/tbar[0]/btn[0]").press
session.findById("wnd[0]/usr/tabsTS/tabpMAIN").select
session.findById("wnd[0]/usr/subITEMS:SAPLFSKB:0100/tblSAPLFSKBTABLE/ctxtACGL_ITEM-HKONT[1,0]").text = "4100100000"
session.findById("wnd[0]/usr/subITEMS:SAPLFSKB:0100/tblSAPLFSKBTABLE/txtACGL_ITEM-WRBTR[4,0]").text = "*"
session.findById("wnd[0]/usr/subITEMS:SAPLFSKB:0100/tblSAPLFSKBTABLE/ctxtACGL_ITEM-PRCTR[27,0]").text = ExcelSheet.cells (row,8).value
session.findById("wnd[0]/usr/subITEMS:SAPLFSKB:0100/tblSAPLFSKBTABLE/txtACGL_ITEM-MENGE[39,0]").text = "1"
session.findById("wnd[0]/usr/subITEMS:SAPLFSKB:0100/tblSAPLFSKBTABLE/ctxtACGL_ITEM-MEINS[40,0]").text = "Ser"
session.findById("wnd[0]/usr/subITEMS:SAPLFSKB:0100/tblSAPLFSKBTABLE/ctxtACGL_ITEM-MATNR[45,0]").text = "FE-SERCONSULTORIA"
session.findById("wnd[0]/usr/subITEMS:SAPLFSKB:0100/tblSAPLFSKBTABLE/btnACGL_ITEM-LTEXT[12,0]").setFocus
session.findById("wnd[0]/usr/subITEMS:SAPLFSKB:0100/tblSAPLFSKBTABLE/btnACGL_ITEM-LTEXT[12,0]").press
session.findById("wnd[1]/usr/subNOTICE:SAPLEENO:1000/btnEENO_TEXTE-EDITOR").press
session.findById("wnd[0]/usr/cntlSCMSW_CONTAINER_2102/shellcont/shell").setDocument 1,ExcelSheet.cells (row,9).value
session.findById("wnd[0]/tbar[0]/btn[3]").press
session.findById("wnd[1]/tbar[0]/btn[5]").press
session.findById("wnd[0]/tbar[1]/btn[9]").press
session.findById("wnd[0]/tbar[0]/btn[11]").press