Eduardo Veras Postado Dezembro 21, 2022 Denunciar Share Postado Dezembro 21, 2022 (editado) Código com erro nas seguintes linhas: 1° ERRO: session.findById("wnd[0]/shellcont/shell/shellcont[1]/shell[0]").pressContextButton "SELECT" session.findById("wnd[0]/shellcont/shell/shellcont[1]/shell[0]").SelectContextMenuItem ("Purchase_Requisitions") 2° ERRO: session.findById("wnd[0]/shellcont/shell/shellcont[1]/shell[1]").selectItem " 1", "&Hierarchy" session.findById("wnd[0]/shellcont/shell/shellcont[1]/shell[1]").ensureVisibleHorizontalItem " 1", "&Hierarchy" session.findById("wnd[0]/shellcont/shell/shellcont[1]/shell[0]").pressButton "COPY" Não estou conseguindo resolver, já tentei de tudo. Segue código detalhado. Sub Criar_OC() Call Star_SAP session.findById("wnd[0]/tbar[0]/okcd").Text = "/nme21n" session.findById("wnd[0]").sendVKey 0 session.findById("wnd[0]/shellcont/shell/shellcont[1]/shell[0]").pressContextButton "SELECT" If Err = 0 Then session.findById("wnd[0]/shellcont/shell/shellcont[1]/shell[0]").pressContextButton "SELECT" session.findById("wnd[0]/shellcont/shell/shellcont[1]/shell[0]").SelectContextMenuItem ("Purchase_Requisitions") session.findById("wnd[0]/usr/ctxtSP$00026-LOW").Text = "19032374" session.findById("wnd[0]/usr/ctxtSP$00026-LOW").SetFocus session.findById("wnd[0]/usr/ctxtSP$00026-LOW").caretPosition = 8 session.findById("wnd[0]/tbar[1]/btn[8]").press session.findById("wnd[0]/usr/ctxtSP$00026-LOW").SetFocus session.findById("wnd[0]/usr/ctxtSP$00026-LOW").caretPosition = 8 session.findById("wnd[0]/tbar[1]/btn[8]").press session.findById("wnd[0]/shellcont/shell/shellcont[1]/shell[1]").selectItem " 1", "&Hierarchy" session.findById("wnd[0]/shellcont/shell/shellcont[1]/shell[1]").ensureVisibleHorizontalItem " 1", "&Hierarchy" session.findById("wnd[0]/shellcont/shell/shellcont[1]/shell[0]").pressButton "COPY" If Err <> 0 Then session.findById("wnd[0]/tbar[1]/btn[8]").press session.findById("wnd[0]/shellcont/shell/shellcont[1]/shell[0]").pressContextButton "SELECT" session.findById("wnd[0]/shellcont/shell/shellcont[1]/shell[0]").SelectContextMenuItem ("Purchase_Requisitions") session.findById("wnd[0]/usr/ctxtSP$00026-LOW").Text = "19032374" session.findById("wnd[0]/usr/ctxtSP$00026-LOW").SetFocus session.findById("wnd[0]/usr/ctxtSP$00026-LOW").caretPosition = 8 session.findById("wnd[0]/tbar[1]/btn[8]").press session.findById("wnd[0]/usr/ctxtSP$00026-LOW").SetFocus session.findById("wnd[0]/usr/ctxtSP$00026-LOW").caretPosition = 8 session.findById("wnd[0]/tbar[1]/btn[8]").press session.findById("wnd[0]/shellcont/shell/shellcont[1]/shell[1]").selectItem " 1", "&Hierarchy" session.findById("wnd[0]/shellcont/shell/shellcont[1]/shell[1]").ensureVisibleHorizontalItem " 1", "&Hierarchy" session.findById("wnd[0]/shellcont/shell/shellcont[1]/shell[0]").pressButton "COPY" End If End If Editado Dezembro 21, 2022 por Eduardo Veras Citar Link para o comentário Compartilhar em outros sites More sharing options...
Pergunta
Eduardo Veras
Código com erro nas seguintes linhas:
1° ERRO:
session.findById("wnd[0]/shellcont/shell/shellcont[1]/shell[0]").pressContextButton "SELECT"
session.findById("wnd[0]/shellcont/shell/shellcont[1]/shell[0]").SelectContextMenuItem ("Purchase_Requisitions")
2° ERRO:
session.findById("wnd[0]/shellcont/shell/shellcont[1]/shell[1]").selectItem " 1", "&Hierarchy"
session.findById("wnd[0]/shellcont/shell/shellcont[1]/shell[1]").ensureVisibleHorizontalItem " 1", "&Hierarchy"
session.findById("wnd[0]/shellcont/shell/shellcont[1]/shell[0]").pressButton "COPY"
Não estou conseguindo resolver, já tentei de tudo.
Segue código detalhado.
Sub Criar_OC()
Call Star_SAP
session.findById("wnd[0]/tbar[0]/okcd").Text = "/nme21n"
session.findById("wnd[0]").sendVKey 0
session.findById("wnd[0]/shellcont/shell/shellcont[1]/shell[0]").pressContextButton "SELECT"
If Err = 0 Then
session.findById("wnd[0]/shellcont/shell/shellcont[1]/shell[0]").pressContextButton "SELECT"
session.findById("wnd[0]/shellcont/shell/shellcont[1]/shell[0]").SelectContextMenuItem ("Purchase_Requisitions")
session.findById("wnd[0]/usr/ctxtSP$00026-LOW").Text = "19032374"
session.findById("wnd[0]/usr/ctxtSP$00026-LOW").SetFocus
session.findById("wnd[0]/usr/ctxtSP$00026-LOW").caretPosition = 8
session.findById("wnd[0]/tbar[1]/btn[8]").press
session.findById("wnd[0]/usr/ctxtSP$00026-LOW").SetFocus
session.findById("wnd[0]/usr/ctxtSP$00026-LOW").caretPosition = 8
session.findById("wnd[0]/tbar[1]/btn[8]").press
session.findById("wnd[0]/shellcont/shell/shellcont[1]/shell[1]").selectItem " 1", "&Hierarchy"
session.findById("wnd[0]/shellcont/shell/shellcont[1]/shell[1]").ensureVisibleHorizontalItem " 1", "&Hierarchy"
session.findById("wnd[0]/shellcont/shell/shellcont[1]/shell[0]").pressButton "COPY"
If Err <> 0 Then
session.findById("wnd[0]/tbar[1]/btn[8]").press
session.findById("wnd[0]/shellcont/shell/shellcont[1]/shell[0]").pressContextButton "SELECT"
session.findById("wnd[0]/shellcont/shell/shellcont[1]/shell[0]").SelectContextMenuItem ("Purchase_Requisitions")
session.findById("wnd[0]/usr/ctxtSP$00026-LOW").Text = "19032374"
session.findById("wnd[0]/usr/ctxtSP$00026-LOW").SetFocus
session.findById("wnd[0]/usr/ctxtSP$00026-LOW").caretPosition = 8
session.findById("wnd[0]/tbar[1]/btn[8]").press
session.findById("wnd[0]/usr/ctxtSP$00026-LOW").SetFocus
session.findById("wnd[0]/usr/ctxtSP$00026-LOW").caretPosition = 8
session.findById("wnd[0]/tbar[1]/btn[8]").press
session.findById("wnd[0]/shellcont/shell/shellcont[1]/shell[1]").selectItem " 1", "&Hierarchy"
session.findById("wnd[0]/shellcont/shell/shellcont[1]/shell[1]").ensureVisibleHorizontalItem " 1", "&Hierarchy"
session.findById("wnd[0]/shellcont/shell/shellcont[1]/shell[0]").pressButton "COPY"
End If
Editado por Eduardo VerasEnd If
Link para o comentário
Compartilhar em outros sites
0 respostass a esta questão
Posts Recomendados
Participe da discussão
Você pode postar agora e se registrar depois. Se você já tem uma conta, acesse agora para postar com sua conta.