ioa747 Posted January 27, 2023 Share Posted January 27, 2023 curious it should appear If $OrderId <> $OrderNext I know that I know nothing Link to comment Share on other sites More sharing options...
Nilkimas Posted January 27, 2023 Author Share Posted January 27, 2023 I thought this might do the trick, but sadly it doesn't Func Process() Local $OrderId, $OrderNext, $Reset = False, $index=3 Local $iFrom = $index While 1 $Amount = $oWorkbook.ActiveSheet.Cells($iFrom, 9).value $OrderId = $oExcel.ActiveWorkBook.ActiveSheet.Cells($index, 3).Value If $OrderId = "" Then ExitLoop $OrderNext = $oExcel.ActiveWorkBook.ActiveSheet.Cells($index + 1, 3).Value If $OrderId <> $OrderNext Then WinActivate("[Title:Agent Desktop]","") Call("SetUp") Send($OrderId) ;Send 10 (as the orderID) <------- Sleep(100) Send("{ENTER}") Call ("MoveMountain") For $i = $iFrom to $index ;ConsoleWrite($oExcel.ActiveWorkBook.ActiveSheet.Cells($i, 4).Value & "; ") kSend($oExcel.ActiveWorkBook.ActiveSheet.Cells($i, 9).Value) kSend ("{DEL 3}") if $i < $index or $i = $index Then kSend("{TAB}") ;tab <------- Next $iFrom = $i ElseIf $OrderId = $OrderNext Then Call("CleanUp", $iFrom) EndIf $index += 1 WEnd EndFunc ;==> Process Link to comment Share on other sites More sharing options...
ioa747 Posted January 27, 2023 Share Posted January 27, 2023 MsgBox give you the right number? in the right time? Func Process() Local $OrderId, $OrderNext, $Reset = False, $index=3 Local $iFrom = $index While 1 $Amount = $oWorkbook.ActiveSheet.Cells($iFrom, 9).value $OrderId = $oExcel.ActiveWorkBook.ActiveSheet.Cells($index, 3).Value If $OrderId = "" Then ExitLoop $OrderNext = $oExcel.ActiveWorkBook.ActiveSheet.Cells($index + 1, 3).Value If $OrderId <> $OrderNext Then WinActivate("[Title:Agent Desktop]","") Call("SetUp") Send($OrderId) ;Send 10 (as the orderID) <------- Sleep(100) Send("{ENTER}") Call ("MoveMountain") For $i = $iFrom to $index ;ConsoleWrite($oExcel.ActiveWorkBook.ActiveSheet.Cells($i, 4).Value & "; ") kSend($oExcel.ActiveWorkBook.ActiveSheet.Cells($i, 9).Value) kSend ("{DEL 3}") if $i < $index or $i = $index Then kSend("{TAB}") ;tab <------- Next $iFrom = $i MsgBox($MB_SYSTEMMODAL, "CleanUp", $iFrom) EndIf $index += 1 WEnd EndFunc ;==> Process I know that I know nothing Link to comment Share on other sites More sharing options...
Nilkimas Posted January 30, 2023 Author Share Posted January 30, 2023 (edited) It doesn't pop up at all... My first line is a single one, nothing pops up, it fills in all the things it needs to do, but once it fills in the value, it kind of stops until it hits enter at a certain point. Not sure why. I got it to work, through trial and error. This seems to work... EndIf $index += 1 If $OrderId<>$OrderNext Then Call("CleanUp", $iFrom, $OrderId, $OrderNext) EndIf WEnd EndFunc ;==> Process Edited January 30, 2023 by Nilkimas Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now