Autohotkey vs. MS Excel 2016

Get help with using AutoHotkey and its commands and hotkeys
Petro
Posts: 1
Joined: 27 Feb 2018, 09:01

Autohotkey vs. MS Excel 2016

27 Feb 2018, 09:15

Hi guys,

I use autohotkey to download invoices from our system, however MS Office was recently updated to 2016 version and I guess that is the reason why my script doesn´t work and should be updated.

When I run it, nothing happen, no even the 1 move. Please see below hot it starts:

Start:

; ---- Allows part of the title to be different
settitlematchmode, 2

WinWait, Microsoft Excel -,
IfWinNotActive, Microsoft Excel -, , WinActivate, Microsoft Excel -,
WinWaitActive, Microsoft Excel -,
Sleep, 100
Send, {CTRLDOWN}c{CTRLUP}
Sleep, 200


Could you please advise how to update this script?

Thank a lot.

Petro
User avatar
Delta Pythagorean
Posts: 485
Joined: 13 Feb 2017, 13:44
GitHub: DelPyth
Location: Somewhere in the US

Re: Autohotkey vs. MS Excel 2016

27 Feb 2018, 10:14

First thing I must say, is that this is the Scripts and Functions section. If you have any questions, please post in the Ask For Help subforum.
Second, I suggest using a ComObj to connect to MS Excel. It will connect to all versions of Excel (AFAIK).
guest3456
Posts: 2756
Joined: 09 Oct 2013, 10:31

Re: Autohotkey vs. MS Excel 2016

27 Feb 2018, 10:20

Petro wrote: I use autohotkey to download invoices from our system, however MS Office was recently updated to 2016 version and I guess that is the reason why my script doesn´t work and should be updated.

Start:

; ---- Allows part of the title to be different
settitlematchmode, 2

WinWait, Microsoft Excel -,
IfWinNotActive, Microsoft Excel -, , WinActivate, Microsoft Excel -,
WinWaitActive, Microsoft Excel -,
Sleep, 100
Send, {CTRLDOWN}c{CTRLUP}
Sleep, 200

So your script is looking for the phrase Microsoft Excel - in the titlebar. If Excel2016 has changed the format and wording of its titlebar, that could be a reason why its failing

burque505
Posts: 1069
Joined: 22 Jan 2017, 19:37

Re: Autohotkey vs. MS Excel 2016

28 Feb 2018, 17:37

Here's some Window Spy shots of Excel 2013 and Excel 2016 with a blank workbook. No 'Microsoft' there anywhere.
I don't have Excel 2003 or Excel 2007, so I can't make a comparison.
Excel13.PNG
Excel13.PNG (36.43 KiB) Viewed 704 times
I bet it'll work if you remove 'Microsoft' from the script.
Regards,
burque505

Edit: Yeah, 2003 and 2007 have Microsoft in the title. Here's a shot of Excel 2003:
Excel03.PNG
Excel03.PNG (89.73 KiB) Viewed 702 times
Attachments
Excel16.PNG
Excel16.PNG (25.9 KiB) Viewed 704 times
User avatar
jeeswg
Posts: 6904
Joined: 19 Dec 2016, 01:58
Location: UK

Re: Autohotkey vs. MS Excel 2016

28 Feb 2018, 17:43

Excel 2007:
Window title (what to use in AHK): Microsoft Excel - Book1
Although the custom title bar says: Book1 - Microsoft Excel
Use AHK's WinGetTitle command to find out what you need. You could also check the alt+tab window/the taskbar button/Task Manager for the window title text.
homepage | tutorials | wish list | fun threads | donate
WARNING: copy your posts/messages before hitting Submit as you may lose them due to CAPTCHA

Return to “Ask For Help”

Who is online

Users browsing this forum: Google [Bot], nitrofenix and 247 guests