Hello All, I have a very simple script that isn't working correctly and I was hoping that this forum could take a look at my script and tell me what I did wrong. Basically, I have a an Excel 2007 spreadsheet that has 100+ acct numbers in the first column. My script activates the excel doc, moves down one row, copies that cell and pastes it into an ERP. Everything works fine within the ERP part of the script, but at the end it starts a new ERP invoice and it is suppose to activate the excel doc, move down a row, and copy that cell. It works the first time but after that it will either not activate the excel doc, not move down one, or move down one but not copy the new cell. Opt("MouseCoordMode", 0) While 1 = 1 $i = 0 Do WinSetState("Microsoft Excel", "", @SW_RESTORE) WinActivate("Microsoft Excel") WinWaitActive("Microsoft Excel") Send("{down}") WinWaitActive("Microsoft Excel") Send("^c") ;;; #cs copy cell from excel ;;; #ce WinSetState("Invoice Entry", "", @SW_RESTORE) WinActivate("Invoice Entry") WinWaitActive("Invoice Entry") MouseClick("left", 150, 100, 2 , 25 ) ;;;#cs selects invoice box ;;; #ce Send("{TAB}") Send("^v") ;;; #cs pastes # in customer box ;;; #ce Send("{TAB}") Send("!c") ;;; #cs calls invoice search/accounts receivable invoice screen ;;; #ce WinWaitActive("Accounts Receivable Invoices") MouseClick("left",60,120, 2) ;;; #cs selects first line in invoice ;;; #ce WinClose("Accounts Receivable Invoices") WinWaitActive("Invoice Entry") WinWaitActive("Invoice Entry") MouseClick("left", 285, 68, 1) ;;; #cs selects the "apply credit memo" button ;;; #ce WinWaitActive("Apply Credit Memo", "", 5) MouseClick("left", 387, 69, 1) ;;; #cs selects the "Amount Applied" cell in the first line of data ;;; #ce MouseClick("left", 52, 409, 1) ;;; #cs selects the save button ;;; #ce WinWaitActive("Invoice Entry") MouseClick("left", 285, 68, 1) ;;; #cs selects the "apply credit memo" button ;;; #ce WinWaitActive("Apply Credit Memo") If MouseClick("left",387, 87, 1) = "" Then Send("!C") Else MouseClick("left", 52, 409, 1) ;;; #cs selects the save button ;;; #ce EndIf WinWaitActive("Invoice Entry") MouseClick("left", 285, 68, 1) ;;; #cs selects the "apply credit memo" button ;;; #ce WinWaitActive("Apply Credit Memo") If MouseClick("left",387, 105, 1) = "" Then Send("!C") Else MouseClick("left", 52, 409, 1) ;;; #cs selects the save button ;;; #ce EndIf WinWaitActive("Invoice Entry") MouseClick("left", 47, 68, 1) $i = $i + 1 Until $i = 200 If $i = 200 then Endif Wend I am very new to this program so please mind my ignorance. Any help would be greatly appreciated. Thank You, Ramona