Gokul Posted January 27, 2014 Share Posted January 27, 2014 (edited) Hi, Is it possible to once login to an application and the execute datas from an excel into the fields in the application. After one row of datas from the excel is entered into the fields the submit button should be clicked. Then the second row of data should be fetched from excel and entered into the field, like this for all rows of data. After all datas are submitted, the application should logout. I have used a code like, #include <excel.au3> #include <array.au3> $file = "Excel_path" $oExcel = _ExcelBookOpen($file, 0) _ExcelSheetActivate($oExcel, "Sheet1") $aArray = _ExcelReadSheetToArray($oExcel, 1) _ArrayDisplay($aArray, "Array using Default Parameters") For $i = 1 to UBound($aArray) $ClickC1_1 =$aArray[$i][1] Run('application_path') _WinWaitActivate("Example Lookup Combobox","") MouseClick("left",$ClickC1_1,71,1) MouseClick("left",458,88,1) Sleep(4000) ;Send("{TAB}") MouseClick("left",480,71,1) MouseClick("left",458,88,1) Sleep(4000) MouseClick("left",479,70,1) MouseClick("left",460,99,1) _ExcelBookClose($oExcel, 0, 0) $oExcel = '' Next But, this opens the application parallelly. Edited February 4, 2014 by Gokul Link to comment Share on other sites More sharing options...
Gokul Posted January 27, 2014 Author Share Posted January 27, 2014 I think i got a solution to this. When i placed the Run command outside the for loop (below _ArrayDisplay($aArray, "Array using Default Parameters")), its working as expected. Link to comment Share on other sites More sharing options...
water Posted January 27, 2014 Share Posted January 27, 2014 To make your script more reliable (independant of screen size and window positions) I would replace all MouseClick and Send statements with ControlClick or ControlSend. My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki Link to comment Share on other sites More sharing options...
Gokul Posted January 27, 2014 Author Share Posted January 27, 2014 (edited) To make your script more reliable (independant of screen size and window positions) I would replace all MouseClick and Send statements with ControlClick or ControlSend. These are comboboxes and when i give ControlCommand, its not working. I gave like, ControlCommand("Title", "", "[NAME:controlname]", "ShowDropDown") ControlCommand("Title", "", "[NAME:controlname]", "SelectString", 'Test') But its not selecting the value 'Test' from the combobox. Edited January 27, 2014 by Gokul 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