on 05-18-2020 11:24 PM
Sub Exe_VL01N()
Dim Application, SapGuiAuto, Connection, session, WScript
Dim x As Integer
Dim qtd As String
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
For x = 0 To 1041
qtd = session.findById("wnd[0]/usr/tabsTAXI_TABSTRIP_OVERVIEW/tabpT\02/ssubSUBSCREEN_BODY:SAPMV50A:1104/tblSAPMV50ATC_LIPS_PICK/ctxtLIPS-LGORT[3," & x & "]").Text
session.findById("wnd[0]/usr/tabsTAXI_TABSTRIP_OVERVIEW/tabpT\02/ssubSUBSCREEN_BODY:SAPMV50A:1104/tblSAPMV50ATC_LIPS_PICK/ctxtLIPS-LGORT[5," & x & "]").Text = qtd
session.findById("wnd[0]").sendVKey 0
Next x
Or maybe
For x = 0 To 1041
session.findById("wnd[0]/usr/tabsTAXI_TABSTRIP_OVERVIEW/tabpT\02/ssubSUBSCREEN_BODY:SAPMV50A:1104/tblSAPMV50ATC_LIPS_PICK/ctxtLIPS-LGORT[5," & x & "]").Text = session.findById("wnd[0]/usr/tabsTAXI_TABSTRIP_OVERVIEW/tabpT\02/ssubSUBSCREEN_BODY:SAPMV50A:1104/tblSAPMV50ATC_LIPS_PICK/ctxtLIPS-LGORT[3," & x & "]").Text
session.findById("wnd[0]").sendVKey 0
Next x
End Sub
At first you select the expect cell then..
Ctrl + Y for copy
Ctrl + V for paste
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi rbshot
I don't know Portuguese, but it looks to me like you have an incorrect ID somewhere in your code.
If I was in your shoes, I'd make the code as simple as possible, with hardcoded values for the moment, and see if it works. When it does, then I'd add some logic to it, make it more complex, but add only one thing at a time. Execute and look for the error. When error shows, I know my latest change is the reason.
Regards,Mateusz
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
99 | |
12 | |
11 | |
6 | |
6 | |
4 | |
3 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.