can you guys tell what's wrong? It keeps running till I hit ctrl+break
#include <Excel.au3>
;wrote by rafael cadina, 03/04/2014 00:00
$Path="C:\Users\rafael.cadina\Desktop\jjj\Detailing Plan\2602 0859 Detailing Plan.xls" ;Set Full Path to Detailing Plan Excel File
$ExcelWB=_ExcelBookAttach($Path) ;Do not change
$ExcelWS="Vaccines_12 - PED" ;Select Worksheet from Detailing Plan Excel File
$NYear=8 ;Number of years analyzed +1
$StratosWindow=("Stratos") ;Set Stratos Window Name
$FirstRow=6 ;First Row Index Containing a Product
$FirstColumn=2 ;First Column Index Containing a Product
$YearRow=4 ;First Row Index Containing a Year
$YearColumn=1 ;First Column Index Containing a Year
$ComboBoxIndex=10 ;Do not change
$WeightIndex=13 ;Do not change
Global $YearRowArray[$NYear] ;years array
_ExcelSheetActivate($ExcelWB,$ExcelWS)
$YearRowArray[1]=$YearRow
$YearCell=_ExcelReadCell($ExcelWB,$YearRow,$YearColumn)
;Set Rows For Each Year in Array
For $k=2 To $NYear
Do
$YearRow=$YearRow+1
$YearCell=_ExcelReadCell($ExcelWB,$YearRow,$YearColumn)
Until $YearCell<>""
$YearRowArray[$k]=$YearRow
Next
$i=$FirstRow
$j=$FirstColumn
$CellValue=_ExcelReadCell($ExcelWB,$i,$j)
For $l=2 To $NYear
While $CellValue<>""
While $CellValue<>""
ControlCommand($StratosWindow,"","TComboBox"&$ComboBoxIndex,"SelectString",$CellValue)
ControlSetText($StratosWindow,"","TSmEdit"&$WeightIndex,_ExcelReadCell($ExcelWB,$i,$j+1)*100)
$i=$i+1
$CellValue=_ExcelReadCell($ExcelWB,$i,$j)
$ComboBoxIndex=$ComboBoxIndex-1
$WeightIndex=$WeightIndex-1
WEnd
$i=$FirstRow
$j=$j+2
$CellValue=_ExcelReadCell($ExcelWB,$i,$j)
$ComboBoxIndex=10
$WeightIndex=13
ControlClick($StratosWindow,"",67984)
WEnd
$j=$FirstColumn
$i=($YearRowArray[$l]+2)
$CellValue=_ExcelReadCell($ExcelWB,$i,$j)
Next