Code: Select all
If !IsObject(XL)
XL := ComObjCreate("Excel.Application")
For ticker in XL.Range("A3:A4") ; 1st loop grabs cell A3 from excel then 2nd loop grabs A4
{
WinWaitActive, ************** ; Activates Window
Click, 90, 47 Left, 1 ; Actives symbol field in inspector
SendRaw, % ticker.Text ; Pastes Ticker grabbed from Excel A3 then A4 on 2nd loop
Send, {Control Down}{a}{Control Up}
Send, {Control Down}{c}{Control Up} ; Copies inspector Output
result := [%clipboard%,%clipboard%] ; Saves clipboard/symbol field
For cell in XL.Range("A1","A2")
{
cell.Value :=result[A_Index] ; Pastes Inspector Output into Excel cells A1 & A2
}
}
result := [%clipboard%,%clipboard%]
I'm looking for the array to be [clipboard value from 1st loop,clipboard value from 2nd loop]
But on 1st loop I get [clipboard value from 1st loop,clipboard value from 1st loop]
and after 2nd loop it ends up [clipboard value from 2nd loop,clipboard value from 2nd loop]