WinMinimize open/active Excel window not working

Get help with using AutoHotkey and its commands and hotkeys
hidefguy
Posts: 57
Joined: 11 Apr 2017, 20:42

WinMinimize open/active Excel window not working

11 Mar 2018, 22:44

When I run the following over an open/active/maximized Excel window, it doesn't minimize. I searched AHK and played around with WinWait, but still same problem

F9::
FileToName := "MyFile"
xlApp := ComObjActive("Excel.Application")
FileTo_Path := A_Desktop "\" FileToName ".xlsx"
FileTo := xlApp.Workbooks.Open(FileTo_Path)
WinMinimize, Microsoft Excel
User avatar
jeeswg
Posts: 6904
Joined: 19 Dec 2016, 01:58
Location: UK

Re: WinMinimize open/active Excel window not working

11 Mar 2018, 23:16

Use this to check the title of the active window:

Code: Select all

WinGetTitle, vWinTitle, A
MsgBox, % vWinTitle
You could try:

Code: Select all

WinMinimize, ahk_class XLMAIN
Is any of your script working? Try adding SoundBeep or a MsgBox, perhaps you need to run the script as Admin.
homepage | tutorials | wish list | fun threads | donate
WARNING: copy your posts/messages before hitting Submit as you may lose them due to CAPTCHA
hidefguy
Posts: 57
Joined: 11 Apr 2017, 20:42

Re: WinMinimize open/active Excel window not working

11 Mar 2018, 23:22

jeeswg wrote: You could try:
WinMinimize, ahk_class XLMAIN
This worked great. You the man :)

Return to “Ask For Help”

Who is online

Users browsing this forum: Auothokeysnoob, Bing [Bot], brotherS, calipsoive, Google [Bot], swagfag, Taurus, tobsto occupied, Yakshongas, ystin and 172 guests