Disable minimize maximize buttons

Dembo

New Member
Joined
Apr 15, 2002
Messages
43
I am trying to disable the minimize/mazimize/close buttons in an excel worksheet to stop users from exiting or changing the size of the worksheet without using the buttons provide on the worksheet.

regards

kd
 

Excel Facts

Excel Can Read to You
Customize Quick Access Toolbar. From All Commands, add Speak Cells or Speak Cells on Enter to QAT. Select cells. Press Speak Cells.
Maybe you could keep things simple by setting your desired screen size and then protecting the workbook with True for the Windows argument. The Structure argument is bypassed on purpose for brevity, which you could insert if you don't want the sheets rearranged. Example:

ActiveWindow.WindowState = xlNormal
ActiveWorkbook.Protect Password:="YourPassword", Windows:=True

This will take those min, max, restore, and close buttons off the active workbook window's title bar (not the Excel application title bar).

'To unprotect the workbook:
ActiveWorkbook.Unprotect Password:="YourPassword"
 
Upvote 0
Thanks for your reply Tom,

I was hoping to be able to disable the application min/max/close buttons, is this possible?

Thanks
kd
 
Upvote 0
OPTION 1
The following statement will prevent windows from being minimized:

ActiveWindow.EnableResize = False


OPTION 2
You can do this with the Workbook_WindowResize event procedure. Put the following code in the workbook code module.

Private Sub Workbook_WindowResize(ByVal Wn As Window)
Wn.WindowState = xlMaximized
End Sub


TO PREVENT APP AND WorkBook Closure:

Private Sub Workbook_BeforeClose(Cancel As Boolean)
Cancel = True
End Sub

SHEET IN FULL SCREEN VIEW :
Public Sub FullScreenView()
Application.DisplayFullScreen = True
End Sub



NOTE: This code needs to be inserted in the "ThisWorkBook" Code Window .
 
Upvote 0

Forum statistics

Threads
1,223,910
Messages
6,175,320
Members
452,635
Latest member
laura12345

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