Select cells in the same row in WPS Office

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
victor-vis
Posts: 13
Joined: 28 Nov 2024, 03:48

Select cells in the same row in WPS Office

Post by victor-vis » 05 Dec 2024, 06:07

Hi,

I'm an Autohotkey newbie.

I have an excel sheet but I open it with WPS Office.

I'd like to select the cells in the same row from col J to col Y.

I've found this script for V1 and it is ok in Excel

Code: Select all

k::
xl := ComObjActive("Excel.Application")
y:=xl.Activecell.row
xl.range("J" y ":Y"y+0).select
return
How can I use this script in wps.exe?

Thanks in advance
Last edited by Ragnar on 05 Dec 2024, 06:37, edited 1 time in total.
Reason: code tags

ShatterCoder
Posts: 170
Joined: 06 Oct 2016, 15:57

Re: Select cells in the same row in WPS Office

Post by ShatterCoder » 06 Dec 2024, 10:31

victor-vis wrote:
05 Dec 2024, 06:07
How can I use this script in wps.exe?
the example code you posted is making use of a COM interface built into the excel application. I'm not familiar with wps.exe but i can pretty much guarantee that it does not have a similar com interface. So the short answer is that you cannot. You may be able to use something like UIA to interface with it, but it's a bit of a learning curve if you are not familiar with the UIA interface. You can learn more about it here:
https://github.com/Descolada/UIAutomation

victor-vis
Posts: 13
Joined: 28 Nov 2024, 03:48

Re: Select cells in the same row in WPS Office

Post by victor-vis » 09 Dec 2024, 03:43

ShatterCoder wrote:
06 Dec 2024, 10:31
victor-vis wrote:
05 Dec 2024, 06:07
How can I use this script in wps.exe?
the example code you posted is making use of a COM interface built into the excel application. I'm not familiar with wps.exe but i can pretty much guarantee that it does not have a similar com interface. So the short answer is that you cannot. You may be able to use something like UIA to interface with it, but it's a bit of a learning curve if you are not familiar with the UIA interface. You can learn more about it here:
https://github.com/Descolada/UIAutomation
Thanks very much for your reply.

I'll try to learn the UIA interface.

I'd like to select cells from a specific column to another, in the same row: do you think there's a script that can operate in the active window and simulate the key "Shift + Right key for n. times"? It is something easy and indipendent from the app used (wps o Excel).

Thanks in advance.

ShatterCoder
Posts: 170
Joined: 06 Oct 2016, 15:57

Re: Select cells in the same row in WPS Office

Post by ShatterCoder » 09 Dec 2024, 16:33

victor-vis wrote:
09 Dec 2024, 03:43
I'd like to select cells from a specific column to another, in the same row: do you think there's a script that can operate in the active window and simulate the key "Shift + Right key for n. times"? It is something easy and indipendent from the app used (wps o Excel).

Thanks in advance.
Sure, simply sending shift right is pretty easy:

Code: Select all

;Use ctrl + alt + F1 to send shift + right 3 times
^!F1::
send_number := 3
send, +{right %send_number%}
return

victor-vis
Posts: 13
Joined: 28 Nov 2024, 03:48

Re: Select cells in the same row in WPS Office

Post by victor-vis » 10 Dec 2024, 03:50

ShatterCoder wrote:
09 Dec 2024, 16:33
victor-vis wrote:
09 Dec 2024, 03:43
I'd like to select cells from a specific column to another, in the same row: do you think there's a script that can operate in the active window and simulate the key "Shift + Right key for n. times"? It is something easy and indipendent from the app used (wps o Excel).

Thanks in advance.
Sure, simply sending shift right is pretty easy:

Code: Select all

;Use ctrl + alt + F1 to send shift + right 3 times
^!F1::
send_number := 3
send, +{right %send_number%}
return
Tooooooop! Thank you very much!

Post Reply

Return to “Ask for Help (v1)”