Code: Select all
^o::
path := "C:\Users\zirje\OneDrive\Desktop\StratAHK.xlsx" ;<--- enter your book path
XL := ComObjCreate("Excel.Application")
XL.Workbooks.Open(path)
XL.Visible := True
Sleep, 300
result := [] ; declare array
Loop, 2
{
Sleep, 300
WinActivate, **********[Longs] -> MODE: LIVE ***********ahk_class RAIL_WINDOW
Sleep, 333
Sleep, 300
MsgBox, 0, , Highlight Strategy
Sleep, 1000
Send, {Control Down}{a}{Control Up}
Sleep, 200
Sleep, 300
Send, {Control Down}{c}{Control Up} ; Copies Output
Sleep, 200
output := clipboard
result.Push(output) ; array.push() appends values to the end of an array
}
For cell in XL.Range("A1:A2")
{
cell.Value :=result[A_Index] ; Pastes Output into Excel
Sleep, 200
MsgBox % result[A_Index]
}
Return