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!
 

Excel Facts

Get help while writing formula
Click the italics "fx" icon to the left of the formula bar to open the Functions Arguments dialog. Help is displayed for each argument.
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
 
Upvote 0
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!
 
Upvote 0

Forum statistics

Threads
1,214,516
Messages
6,119,981
Members
448,934
Latest member
audette89

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top