on 12-08-2023 10:35 AM
Estou tentando buscar 2 valores de uma árvores após fazer uma busca de texto dentro dessa mesma árvore. até o momento estou parado aqui
lrow = Ferramenta1.Range("C500000").End(xlUp).row
Set sap = New sapScript
Status = False
For Line = 2 To lrow
If Ferramenta1.Range("D" & Line).Text = "" Or Ferramenta1.Range("S" & Line).Text <> "EM ANDAMENTO" Or Ferramenta1.Range("D" & Line).Text = "0" Then GoTo nextLine
sap.Init "VT03N"
sap.SetText "wnd[0]/usr/ctxtVTTK-TKNUM", ""
sap.SetText "wnd[0]/usr/ctxtVTTK-TKNUM", Left(Ferramenta1.Range("D" & Line).Text, 10)
sap.Press "wnd[0]/tbar[1]/btn[5]"
msgNumber = sap.GetMessageNumber
If msgNumber = "699" Then
Ferramenta1.Range("D" & Line).Interior.Color = vbRed
GoTo nextLine
End If
sap.Find
sap.SetText "wnd[1]/usr/txtLVC_S_SEA-STRING", "Entrega"
sap.Press "wnd[1]/tbar[0]/btn[0]"
If aba = False Then
sap.Press "wnd[1]/tbar[0]/btn[0]"
sap.Find
sap.SetText "wnd[1]/usr/txtLVC_S_SEA-STRING", "Reabastec."
sap.Press "wnd[1]/tbar[0]/btn[0]"
If aba = False Then GoTo nextLine
End If
sap.Press "wnd[1]/tbar[0]/btn[12]"
sap.SelectSap "wnd[0]/mbar/menu[2]/menu[8]"
sap.Find
sap.SetText "wnd[1]/usr/txtLVC_S_SEA-STRING", "Doc."
sap.Press "wnd[1]/tbar[0]/btn[0]"
If aba = False Then GoTo nextLine
sap.Press "wnd[1]/tbar[0]/btn[12]"
'get text from cloumn 2 and 3 from the line that i have found
Ferramenta1.Range("AI" & Line).Value = Column2 & " " & Column3
Ferramenta1.Range("S" & Line).Value = "PARA FINALIZAR"
User | Count |
---|---|
82 | |
10 | |
10 | |
9 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.