how to get the address of the excel cell under the current mouseover
how to get the address of the excel cell under the current mouseover
ahk how to get the address of the excel cell under the current mouseover
Re: how to get the address of the excel cell under the current mouseover
Code: Select all
xl := ComObj("Excel.Application")
MouseGetPos x,y,A
ToolTip % xl.ActiveWindow.RangeFromPoint(x,y).Address
Re: how to get the address of the excel cell under the current mouseover
The A you have in your MouseGetPos statement isn’t identifying the active window. You identified A as the variable in which to store the HWND/unique ID of the window under the mouse (and then not use it).
Unless your Excel window is full screen or otherwise is located at 0,0, then you need to specify CoordMode, Mouse, Screen, as in this demo:
Unless your Excel window is full screen or otherwise is located at 0,0, then you need to specify CoordMode, Mouse, Screen, as in this demo:
Code: Select all
xl := ComObj("Excel.Application")
Coordmode, Mouse, Screen
loop {
MouseGetPos x,y
ToolTip % xl.ActiveWindow.RangeFromPoint(x,y).Address
Sleep, 50
}
return
Esc::Exitapp