I am new in AHK scripting, I have a task of which I need to copy paste a series of cells in a column in a specific excel file one by one through hitting a hotkey every time and it is pasting it into another program and when hitting again the hotkey it goes to the next cell copying it and pasting to the other program etc.
I have used the Winactivate function to limit the process only between the excel file and the the running program.
Recently, I have experienced that it is just doing copy paste for the first time when hitting the hotkey, But when hitting the hotkey again to copy the next cell, It doesn't work
and still remains in the program window
How can I solve this problem ?
Thanks in advance for your kind help
The following is my script that I have written:
Code: Select all
!e::
WinActivate, Test1 - Excel ahk_class XLMAIN
send, {Down}
send, ^c
WinActivate, Program Server 1 ahk_class Program
Click, 229, 228, 2
sleep,300
send, ^v
send, {enter}
clipboard =
sleep,100
return
!b::
WinActivate, Test1 - Excel ahk_class XLMAIN
send, {Up}
send, ^c
WinActivate, Program Server 1 ahk_class Program
Click, 229, 228, 2
sleep,300
send, ^v
send, {enter}
clipboard =
sleep,100
return
!x::ExitApp