Error 619 - SAP

deadpool1

New Member
Joined
Mar 5, 2017
Messages
1
Hello,

I included a snippet of a code I use to automate invoice printing one by one, using invoices from Excel.
I have problem to make an error handling code that will handle error #619.

Basically, the way my sub work is that when an invoice is available, it will open a new window "session.findById("wnd[1] " and I can continue to run the code. Otherwise, it will give error # 619. The code I have below only works for the first problematic invoice! 2nd problematic error, it will throw an error.

I tried to handle this by opening a new session when an error occurs, by clearing the error before next loop, but nothing works.

I'd like to request your help to understand what can I do to improve my code.

Thank you

Code:
For i = 1 To lstrow
inv = Cells(i, 1).Value


session.sendcommand ("/nVF03")
session.findById("wnd[0]/usr/ctxtVBRK-VBELN").Text = inv
session.findById("wnd[0]/mbar/menu[0]/menu[11]").Select


On Error GoTo here
session.findById("wnd[0]/mbar/menu[0]/menu[11]").Select
session.findById("wnd[1]/usr/tblSAPLVMSGTABCONTROL").getAbsoluteRow(0).Selected = True <--problematic line
session.findById("wnd[1]/tbar[0]/btn[37]").press
session.findById("wnd[0]/tbar[0]/okcd").Text = "pdf!"
session.findById("wnd[0]").sendVKey 0

...

here:
next i
 

Excel Facts

Why does 9 mean SUM in SUBTOTAL?
It is because Sum is the 9th alphabetically in Average, Count, CountA, Max, Min, Product, StDev.S, StDev.P, Sum, VAR.S, VAR.P.

Forum statistics

Threads
1,214,985
Messages
6,122,606
Members
449,089
Latest member
Motoracer88

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