thanks for reply. below are the whole code. #include <excel.au3>
WinActivate('Gii (3.8.0.42) - KUN_XIANG - AGIIP_BU_CN - 374 - China - \\Remote');active ERP
Sleep(2000)
Send('+{F8}');ERP internal hotkey, change page to Order detail page
Sleep(1000)
Send('{F2}');ERP internal hotkey, ask me if i search for a specific order#
WinWait('Gii - \\Remote');when press F2, this window show up
Send('{ENTER}');yes - i search for a specific order#
WinWait('Order Search - \\Remote');Order search window show up
WinActivate('Order Search - \\Remote')
MouseClick('primary',533,374,1,0);choose one type of the order#, i could not use ID to choose because Finder could not detect anything
MouseClick('primary',614,517,1,0);then activate the input window
;################################Open the Excel file where stores the order# and copy cells('2','W'),order Number########################
Local $oExcel=_Excel_Open()
Local $oWorkbook1 = _Excel_BookOpen($oExcel, @ScriptDir & '\CQ_FY16Q3_W10.xlsm',False)
Local $oRange = $oWorkbook1.worksheets('sheet1').cells(2,'w')
Local $oTargetRange = $oWorkbook1.worksheets('sheet1').cells(2,'BY')
_Excel_RangeCopyPaste($oWorkbook1.worksheets('sheet1'), $oRange)
;TargetRange will be used to store the later data which copied form the ERP. I just try to do it once, when it works, it would be a loop that happens more than 300,000 times
;because i have more than 300,000 order row in excel every Q, currently it's a manual work, 3 months later maybe IT could do it for us, but we need it very urgently
;some times we have to do it the whole team#####
Sleep(2000)
WinActivate('Order Search - \\Remote')
Send('^v');paste the copied order# to ERP input box, works
Send('{ENTER}');then search
WinWait('Order Details - \\Remote')
sleep(2000)
Send('{ENTER}');some details show up, no useful, click enter to pass
WinWait('List Price / Cost Changes - \\Remote')
Send('{ENTER}');same as above
Sleep(10000)
Opt('mousecoordmode',0)
WinActivate('Gii (3.8.0.42) - KUN_XIANG - AGIIP_BU_CN - 374 - China - \\Remote')
MouseClick('primary',1199,433);click the detail of order, because Finder tool can not detect anything, i have to use the XY to click it
WinWait('Internet Explorer - \\Remote');details show up, first the window, then some details, so sleep 5secs
Sleep(5000)
MouseClick('primary',194,253,2,0);where i need to copy
Send('^c');copy
Sleep(2000)
WinActivate('CQ_FY16Q3_W10.xlsm');activate EXCEL
$oTargetRange.Select;select target ragne, 'BY2'
Send('^v'); CTRL V, does not work....
_Excel_RangeWrite($oWorkbook1,'shee1',ClipGet(),$oTargetRange);does not work either....help!!!!!!!!!!!!!