Jump to content
Fórum Script Brasil
  • 0

como posso voltar uma linha de comando com VBSCRIPT.


Roberval Nascimento

Question

EXEMPLO: Abaixo vocês vão ver um (LOOP) para realizar uma fatura no SAP porem antes ele faz uma pesquisa, e é ai que vocês entrão

o comando (GOTO) que funciona muito bem no excel aqui no VBS não funciona e gostaria de saber como posso subistituir


If Session.findById("wnd[0]/usr/sub/1[0,0]/sub/1/3[0,2]/sub/1/3/4[0,6]/lbl[65,6]").Text <> 0 Then

NOVAMENTE: 'AQUI DE ONDE ELE IRÁ VOLTAR

    For X = 1 To 1000

        Session.findById("wnd[0]/usr/sub/1[0,0]/sub/1/3[0,2]/sub/1/3/4[0,6]/lbl[15,6]").SetFocus 'SELECIONA A DT
        Session.findById("wnd[0]/usr").verticalScrollbar.Position = POSICAO
        Session.findById("wnd[0]/usr").verticalScrollbar.Position = POSICAO + 1

        If Session.findById("wnd[0]/usr/sub/1[0,0]/sub/1/3[0,2]/sub/1/3/4[0,6]/lbl[65,6]").Text = 0 Then

            Session.findById("wnd[0]/usr/sub/1[0,0]/sub/1/3[0,2]/sub/1/3/4[0,6]/lbl[31,6]").SetFocus 'SELECIONA O +
            Session.findById("wnd[0]").sendVKey 2 'CLICA NO +

            Session.findById("wnd[0]/usr/sub/1[0,0]/sub/1/3[0,2]/sub/1/3/4[0,6]/sub/1/3/4/5[0,7]/lbl[17,7]").SetFocus
            Session.findById("wnd[0]").sendVKey 2 'CLICA NO +

            Session.findById("wnd[0]/usr/tabsTAXI_TABSTRIP_OVERVIEW/tabpT\02").Select 'SELECIONA A 2ª ABA PICKING

            LIN_SAP = 0
            For W = 1 To 10

                AA = Session.findById("wnd[0]/usr/tabsTAXI_TABSTRIP_OVERVIEW/tabpT\02/ssubSUBSCREEN_BODY:SAPMV50A:1104/tblSAPMV50ATC_LIPS_PICK/ctxtLIPS-MATNR[1," & LIN_SAP & "]").Text
                Session.findById("wnd[0]/usr/tabsTAXI_TABSTRIP_OVERVIEW/tabpT\02/ssubSUBSCREEN_BODY:SAPMV50A:1104/tblSAPMV50ATC_LIPS_PICK/ctxtLIPS-MATNR[1," & LIN_SAP & "]").SetFocus
                LIN_SAP = LIN_SAP + 1

                If W >= 7 Then GoTo CONTINUAR 'AQUI ELE SAI DO LOOP

                If AA = "" Then
                    Session.findById("wnd[0]").sendVKey 3
                    Session.findById("wnd[0]/usr/sub/1[0,0]/sub/1/3[0,2]/sub/1/3/4[0,6]/lbl[31,6]").SetFocus 'SELECIONA O +
                    Session.findById("wnd[0]").sendVKey 2 'CLICA NO +
                    POSICAO = POSICAO + 2

                    GoTo NOVAMENTE 'AQUI ELE VOLTA PRO INICIO DO LOOP

                End If

            Next

        End If

        POSICAO = POSICAO + 2

    Next

End If

CONTINUAR: 'AQUI É DE ONDE ELE CONTINUA O PULO
 

Link to comment
Share on other sites

0 answers to this question

Recommended Posts

There have been no answers to this question yet

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



  • Forum Statistics

    • Total Topics
      152.1k
    • Total Posts
      651.7k
×
×
  • Create New...