VBA & SAP GUI Script Error "619": Control Could Not Be Found by ID

j_perri

New Member
Joined
Apr 17, 2018
Messages
2
Hello there,
We've been running this VBA Macro for a while then it suddenly stopped working. I tried to specify the 'session.StartTransaction' window again, but it still doesn't work as it runs into 'Error 619: Control could not be found by ID.
Here's the script:
The debug stops at this line when the error message occurs:
session.findById("wnd[0]/usr/tabsTAXI_TABSTRIP_OVERVIEW/tabpT\01/ssubSUBSCREEN_BODY:SAPMV45A:4400/subSUBSCREEN_TC:SAPMV45A:4900/subSUBSCREEN_BUTTONS:SAPMV45A:4050/btnBT_MKAL").press Set SapGuiAuto = GetObject("SAPGUI")
Set App = SapGuiAuto.GetScriptingEngine
Set Connection = App.Children(0)
Set session = Connection.Children(0)

lr
= Cells(Rows.Count, "A").End(xlUp).Row
For i = 2 To lr

session
.findById("wnd[0]").maximize
session
.startTransaction "/nVA02"
session
.findById("wnd[0]/usr/ctxtVBAK-VBELN").Text = Cells(i, 1)
session
.findById("wnd[0]").sendVKey 0
session
.findById("wnd[0]/usr/tabsTAXI_TABSTRIP_OVERVIEW/tabpT\01/ssubSUBSCREEN_BODY:SAPMV45A:4400/subSUBSCREEN_TC:SAPMV45A:4900/subSUBSCREEN_BUTTONS:SAPMV45A:4050/btnBT_MKAL").press
session
.findById("wnd[0]/mbar/menu[1]/menu[1]/menu[0]").Select session.findById("wnd[1]/usr/cmbRV45A-S_ABGRU").Key = "11"
session
.findById("wnd[1]/tbar[0]/btn[7]").press

If session.ActiveWindow.Name = "wnd[2]" Then
session
.findById("wnd[2]/tbar[0]/btn[0]").press
End If

session
.findById("wnd[0]/tbar[0]/btn[11]").press
Cells
(i, 2) = session.findById("wnd[0]/sbar").Text
Next i

End Sub
 

Excel Facts

Format cells as time
Select range and press Ctrl+Shift+2 to format cells as time. (Shift 2 is the @ sign).

Forum statistics

Threads
1,224,823
Messages
6,181,183
Members
453,020
Latest member
Mohamed Magdi Tawfiq Emam

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top