Jump to content

Recommended Posts

Posted (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 by Gokul
Posted

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.

Posted

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 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Posted (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 by Gokul

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...