Results 1 to 4 of 4
  1. #1
    3 Star Lounger
    Join Date
    Feb 2003
    Posts
    363
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Remove (or disable) X close button (xl2K)

    Is there a way of temporarily removing (hiding or disabling) the CLOSE button ( the X in the upper right hand corner) of a workbook? I'd also like to do the same with the minimize/maximize buttons.

    If so, I'd also need to know how to reset them.
    Thanks

  2. #2
    Gold Lounger
    Join Date
    Feb 2001
    Location
    Dublin, Ireland, Republic of
    Posts
    2,697
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Re: Remove (or disable) X close button (xl2K)

    From the Tools menu you can select Protection, then Workbook and make sure th echeckbox beside Windows is checked.

    Just unprotect the workbook to revers.

    In VBA use

    ActiveWorkbook.Protect Windows:=True '(False to reverse)

    Andrew C

  3. #3
    3 Star Lounger
    Join Date
    Feb 2003
    Posts
    363
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Remove (or disable) X close button (xl2K)

    Thanks Andrew

    Next Q
    After protecting the workbook, and saving it, it is reduced in size upon reopening it. How can I prevent this size change?

  4. #4
    Gold Lounger
    Join Date
    Feb 2001
    Location
    Dublin, Ireland, Republic of
    Posts
    2,697
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Re: Remove (or disable) X close button (xl2K)

    Try using the following Workbook open code :

    Private Sub Workbook_Open()
    With Me
    .Unprotect ' , Password:="Pass"
    .Windows(1).WindowState = xlMaximized
    .Protect Windows:=True ', Password:="Pass"
    End With
    End Sub

    If you used a password to protect the windows, you would need to replace "Pass" with the actual password.

    Andrew C

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •