Why my controlgettext failed?

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
woshichuanqilz72
Posts: 117
Joined: 05 Oct 2015, 21:23

Why my controlgettext failed?

22 Jun 2017, 23:34

The code works fine on the notepad, but it doesn't work on Excel? Why is that ?

the code I use is this :

Code: Select all

ControlGetText, Position, Edit1, - Excel
User avatar
boiler
Posts: 16925
Joined: 21 Dec 2014, 02:44

Re: Why my controlgettext failed?

23 Jun 2017, 03:01

Because Notepad has a control named Edit1 and Excel doesn't.
Rohwedder
Posts: 7626
Joined: 04 Jun 2014, 08:33
Location: Germany

Re: Why my controlgettext failed?

23 Jun 2017, 08:00

Hallo,
my Excel 2010 has Edit1
look:

Code: Select all

q::
ControlGetPos , X, Y, Width, Height, Edit1, ahk_class XLMAIN
MouseMove , X + Width/2, Y + Height/2
Return
User avatar
boiler
Posts: 16925
Joined: 21 Dec 2014, 02:44

Re: Why my controlgettext failed?

23 Jun 2017, 08:50

You're right. Didn't think to try the cell selector box. It appears not to provide its contents as a normal edit control would.
woshichuanqilz72
Posts: 117
Joined: 05 Oct 2015, 21:23

Re: Why my controlgettext failed?

24 Jun 2017, 01:33

Rohwedder wrote:Hallo,
my Excel 2010 has Edit1
look:

Code: Select all

q::
ControlGetPos , X, Y, Width, Height, Edit1, ahk_class XLMAIN
MouseMove , X + Width/2, Y + Height/2
Return
It works fine when I use the controlclick and controlsettext, but it doesn't work when I use controlgettext.
I already get it done by the workaround controlclick, tnx a lot for your reply ~

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Descolada and 286 guests