ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   disable close and shrink buttons (https://www.excelbanter.com/excel-programming/303499-disable-close-shrink-buttons.html)

Jason L.

disable close and shrink buttons
 
Hello,
I've been looking for a way to disable the close ("X") and shrink buttons that are located at the upper-right part of the spreadsheet. This will ensure that the user uses the button containing the macros I have created.

Is this possible? Please help.

thanks in advance,
Jason


keepITcool

disable close and shrink buttons
 
Jason, it's not only possible.. it's easy :)

lock the windows of the activebook:

tools/protect/workbook
structure OFF
windows ON

PLUS
in this workbook
Private Sub Workbook_BeforeClose(Cancel As Boolean)
If Not blnByCode Then Cancel = True
End Sub


where blnByCode is a module lavel boolean variable you can set in your
other macor to close the workbook.


keepITcool

< email : keepitcool chello nl (with @ and .)
< homepage: http://members.chello.nl/keepitcool


"Jason L." wrote:

Hello,
I've been looking for a way to disable the close ("X") and shrink
buttons that are located at the upper-right part of the spreadsheet.
This will ensure that the user uses the button containing the macros I
have created.

Is this possible? Please help.

thanks in advance,
Jason




Jason[_33_]

disable close and shrink buttons
 
Thanks a lot keepITcool! It works like a charm!

-----Original Message-----
Jason, it's not only possible.. it's easy :)

lock the windows of the activebook:

tools/protect/workbook
structure OFF
windows ON

PLUS
in this workbook
Private Sub Workbook_BeforeClose(Cancel As Boolean)
If Not blnByCode Then Cancel = True
End Sub


where blnByCode is a module lavel boolean variable you

can set in your
other macor to close the workbook.


keepITcool

< email : keepitcool chello nl (with @ and .)
< homepage: http://members.chello.nl/keepitcool


"Jason L." wrote:

Hello,
I've been looking for a way to disable the close ("X")

and shrink
buttons that are located at the upper-right part of

the spreadsheet.
This will ensure that the user uses the button

containing the macros I
have created.

Is this possible? Please help.

thanks in advance,
Jason



.



All times are GMT +1. The time now is 11:28 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com