I'm afraid there is no
Targettype parameter (which is the first parameter of
Coordmode) called
Screen according to the docs.
But you could do
Code: Select all
Coordmode, Mouse, Screen ; or
Coordmode, Mouse ; Same as above because "screen" is the default for Coordmode second parameter.
This part I don't understand:
Code: Select all
InputBox,OutputVar,Paste clipboard content
sendclipboard:
controlSend,,^v,Paste clipboard content
Why an
inputbox here, especially if you do nothing with the input that gets saved in Outputvar?
I would rather use just
Send instead of
Controlsend since - at this point - you already clicked into the cell. Well, okay, the inputbox might take this focus away, but just remove it, if you have no use for it. Also, the Wintitle "Paste clipboard content" that you use here with Controlsend will probably prevent that ^v gets sent at Excel at all (and the Inputbox with this wintitle is already closed at this point anyway).
Some additional thoughts:
You could also think about pulling the line
WinActivate, Book1 - Excel ahk_class XLMAIN into the hotkey definition, depending on your actual work flow, so that the window always gets activated before you try to paste something. But perhaps you would rather want a context-sensitive
hotkey instead...
Finally, Excel has also a COM interface which would give you a more reliable method to to the pasting. Just some ideas to look up in the docs and the forum...