Detecting when the Excel Application has been minimized

sbendbuckeye

Active Member
Joined
Nov 26, 2003
Messages
440
Hello all,

How can I detect the user clicking the Minimize button on the title bar? Thanks in advance for any ideas and/or suggestions!
 

Some videos you may like

Excel Facts

What is =ROMAN(40) in Excel?
The Roman numeral for 40 is XL. Bill "MrExcel" Jelen's 40th book was called MrExcel XL.

VoG

Legend
Joined
Jun 19, 2002
Messages
63,650
I don't know if you can detect the click but you can nquery the window status:

Code:
Sub ReturnWindowState()
    Dim szState As String
    Select Case Application.WindowState
        Case xlMaximized
            szState = "Maximized"
        Case xlMinimized
            szState = "Minimized"
        Case xlNormal
            szState = "Normal"
    End Select
    MsgBox "Window state is: " & szState
End Sub
 

sbendbuckeye

Active Member
Joined
Nov 26, 2003
Messages
440
Hello,

Thanks for the response. I have a custom menu item that needs to run some code when the Excek application itself is minimized or loses focus. The Excel Application events are all WorkBook, WorkSheet or Window events pertaining to inter Excel workings.

I'm guessing I will need to use the API somehow, but I'm not sure where to start. Thanks again!
 

Watch MrExcel Video

Forum statistics

Threads
1,109,522
Messages
5,529,330
Members
409,863
Latest member
stacy09
Top