View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
libby libby is offline
external usenet poster
 
Posts: 96
Default turning off minimize, maximize & close

Hi

Not sure about the minimise/maximise but you can disable
the close button by using a CloseSwitch variable

Public CloseSwitch

Sub Workbook_Open()
CloseSwitch = True 'set the switch to true
end sub

Sub Workbook Before_Close()
Select Case CloseSwitch
Case True
Cancel = True 'Workbook can't be closed
Case False
Cancel = False 'Workbook can be closed
End Select

Having set the CloseSwitch to True on opening the
workbook, the workbook can't be closed. Set the
CloseSwitch to False in your AutoClose macro and the
workbook will close.





-----Original Message-----
I want to add a level of security to my file to force the

file to auto close by macro only. I've added code to turn
of the menus. Is there code I can include to turn off the
three icons in the upper left corner; minimize,
restor/maximize & close?

Thanks.

Kevin
.