PDA

View Full Version : Prevent Restore Down



av8tordude
08-07-2011, 11:13 AM
Is there a way to prevent the user from clicking the restore down (keep window in the Maximize size)?

mikerickson
08-07-2011, 11:34 AM
You could put this in the ThisWorkbook code module.

Private Sub Workbook_SheetSelectionChange(ByVal Sh As Object, ByVal Target As Range)
ActiveWindow.WindowState = xlMaximized
End Sub

av8tordude
08-07-2011, 05:03 PM
Hi Mike,

I'm still able to restore down the application window. I would like to disable this feature so that user can not use it.

Kenneth Hobs
08-07-2011, 09:04 PM
Doing that is an Application level event. As such, a DLL would be needed which is not trivial.

A timer method might work but that slows things down and things can go amiss. If that interests you, see the commented link. Put this code in ThisWorkbook object. Of course you can the same in the open event.
Private Sub Workbook_WindowResize(ByVal Wn As Window)
Wn.WindowState = xlMaximized
'http://www.xtremevbtalk.com/showthread.php?t=279496, Timer method
Application.WindowState = xlMaximized
End Sub