Jump to content

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


Gokul
 Share

Recommended Posts

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
Link to comment
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 2022-02-19 - Version 1.6.1.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 (NEW 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

 

Link to comment
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.

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
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...