Jump to content

Application not executed


Gokul
 Share

Recommended Posts

Hi,

When i try to run a data driven script in my machine, the application is not executed. It gets executed, when the code is exceuted without taking data from excel. When the script is  changed to take data from excel, the script does not open application. The script is,

#include <excel.au3>
#include <array.au3>
 
$file = "Excel_path"
$oExcel = _ExcelBookOpen($file, 0)     ; open excel in the background
_ExcelSheetActivate($oExcel, "Sheet1")        ; Specify the Sheet name "Names"
$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 = '';clean var
 
Next
Link to comment
Share on other sites

  • Moderators

So you need to put some error checking in your script. If, as I assume, you get as far as your _ArrayDisplay, you need to put in error checking after that point to see where it is failing. I would start with the following block, and move on from there.

$ClickC1_1 = $aArray[$i][1]
   ConsoleWrite($ClickC1_1 & @LF) ;Is the variable what you would expect it to be?
$sPath = 'Path to Application'
Run($sPath)
   If @error Then MsgBox(0, $sPath, @error)

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Link to comment
Share on other sites

 

So you need to put some error checking in your script. If, as I assume, you get as far as your _ArrayDisplay, you need to put in error checking after that point to see where it is failing. I would start with the following block, and move on from there.

$ClickC1_1 = $aArray[$i][1]
   ConsoleWrite($ClickC1_1 & @LF) ;Is the variable what you would expect it to be?
$sPath = 'Path to Application'
Run($sPath)
   If @error Then MsgBox(0, $sPath, @error)

The console has a result as > ' path of autoit exe ' /ErrorStdOut ' path of script '. > Exit code: 0    Time: 0.062. I think the error message is not got in console.

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...