• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

VBA Code should resume the next step in case of any error

Vignesh M

New Member
Dears,

I created a Excel VBA file to pull out the Customer open items from SAP. I used Do While command to repeat the steps for the entire Customer accounts pasted in the sheet "Master". I need your help to skip some line items (please refer module comments in the attached file) and continue the Do While command, since some of the customer accounts may not have any open items so macro will throw error.

I need to skip these line items if there are no open items in SAP and continue Do While.

<Code to Skip>
session.findById("wnd[0]/usr/lbl[14,10]").SetFocus
session.findById("wnd[0]/usr/lbl[14,10]").caretPosition = 7
session.findById("wnd[0]").sendVKey 2
session.findById("wnd[0]").sendVKey 3
session.findById("wnd[0]").sendVKey 3
<Code End>

Please help.

Thanks,
Vignesh M
 

Attachments

  • SAP_Error_Handling.xlsm
    16.7 KB · Views: 1
Last edited:
I have take the help of :

For skipping the error:
Code:
On Error Resume Next


See the attached hope it helps..
 

Attachments

  • SAP_Error_Handling.xlsm
    17.1 KB · Views: 4
Back
Top