Quantcast
Channel: AutoIt v3 - General Help and Support
Viewing all articles
Browse latest Browse all 12506

What is wrong with my Loop ....While/Wend

$
0
0

 Hello all.

 

You are master in autoit maybe can tell me easily... Whats wrong with my Loop ?

AutoIt         
HotKeySet("{ESC}", "Terminate") #include <Excel.au3> #include <IE.au3> Global $sExcelFile = "C:\Users\e8760255\Desktop\Pasta1.xls" ; <== Add the name of the Excel file here and your User Global $oExcel = _ExcelBookOpen($sExcelFile) Global $aExcelData = _ExcelReadSheetToArray($oExcel);$oExcel $oIE = _IECreate() _IENavigate($oIE, "https://webhomolog.fazenda.sp.gov.br/simp"); https://webhomolog.fazenda.sp.gov.br/simp ;=======================>FROM HERE While 1 $o_form = _IEFormGetObjByName($oIE, "form1") $o_txtCpf = _IEFormElementGetObjByName($o_form, "txtCpf") $o_txtNumDoc = _IEFormElementGetObjByName($o_form, "txtNumDoc") $O_btnConsultar = _IEFormElementGetObjByName($o_form, "btnConsultar") For $iRow = 1 To $aExcelData ; Process all read Excel rows     _IEFormElementSetValue($o_txtCpf, $aExcelData[$iRow][1])     _IEFormElementSetValue($o_txtNumDoc, $aExcelData[$iRow][2]) Next $O_btnConsultar.click _IELoadWait($oIE) $o_form = _IEFormGetObjByName($oIE, "_ctl0") $o_btnContinuar = _IEFormElementGetObjByName($o_form, "btnContinuar") If IsObj($o_btnContinuar) Then $o_btnContinuar.click _IELoadWait($oIE) EndIf If not isObj($o_btnContinuar) Then $o_form = _IEFormGetObjByName($oIE, "Form1") $o_btnGare = _IEFormElementGetObjByName($o_form, "btnGare") $o_btnGare.click _IELoadWait($oIE) EndIf $o_form = _IEFormGetObjByName($oIE, "Form1") $o_btnGare = _IEFormElementGetObjByName($o_form, "btnGare") $o_btnGare.click _IELoadWait($oIE) ; Doc informations $o_form = _IEFormGetObjByName($oIE, "Form1") $o_txtObs = _IEFormElementGetObjByName($o_form, "txtObs") $o_txtDataPagto = _IEFormElementGetObjByName($o_form, "txtDataPagto") $o_txtReceita = _IEFormElementGetObjByName($o_form, "txtReceita") For $iRow = 1 To $aExcelData ; Process all read Excel rows     _IEFormElementSetValue($o_txtObs, $aExcelData[$iRow][3])     _IEFormElementSetValue($o_txtDataPagto, $aExcelData[$iRow][4])     _IEFormElementSetValue($o_txtReceita, $aExcelData[$iRow][5]) Next $o_form = _IEFormGetObjByName($oIE, "Form1") $o_btnCalculoProd = _IEFormElementGetObjByName($o_form, "btnCalculoProd") $o_btnCalculoProd.click _IELoadWait($oIE) $o_form = _IEFormGetObjByName($oIE, "Form1") $o_btnGera = _IEFormElementGetObjByName($o_form, "btnGera") $o_btnGera.click _IELoadWait($oIE) Sleep (6000) Send("{CTRLDOWN}") Send("{SHIFTDOWN}") Send("s") Send("{CTRLUP}") Send("{SHIFTUP}") Sleep (3000) Send("{ALTDOWN}") Send("s") Send("{ALTUP}") Sleep (1500) Send("!{F4}") Sleep (1500) $o_form = _IEFormGetObjByName($oIE, "_ctl0");Form1 $o_btnSair = _IEFormElementGetObjByName ($o_form, "btnSair") $o_btnSair.click _ExcelRowDelete($oExcel,1) ;=======================>TO HERE WEnd Func Terminate()     Exit 0 EndFunc

Appreciate your help.


Viewing all articles
Browse latest Browse all 12506

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>