Sign in to follow this  
Followers 0
Gokul

Run an application once, enter all data from excel and then logout the application

4 posts in this topic

#1 ·  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

Share this post


Link to post
Share on other sites



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.

Share this post


Link to post
Share on other sites

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 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

#4 ·  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

Share this post


Link to post
Share on other sites

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
Sign in to follow this  
Followers 0