Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 414
Default disable the close "X" icon

I want to disable the close "X" icon on a workbook and worksheet. I have a
EXIT button on the worksheet aleady. Thanks for your help in advance!
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,646
Default disable the close "X" icon

ToolsProtectionWorkbooks
Check the Window CheckBox
Stefi


€žAndy€ť ezt Ă*rta:

I want to disable the close "X" icon on a workbook and worksheet. I have a
EXIT button on the worksheet aleady. Thanks for your help in advance!

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,298
Default disable the close "X" icon

name a cell 'GoodToClose and set its value to FALSE

your exit button code should set this to TRUE

Add the following code to the code page of ThisWorkbook

Option Explicit
Private Sub Workbook_BeforeClose(Cancel As Boolean)
Cancel = Not (ThisWorkbook.Names.Item("GoodToClose").RefersToRa nge = True)
End Sub

The Cancel variable will be true, thus preventing the workbook closing if
the value of the range 'GoodToClose' is not set to TRUE
Note: This will also prevent Excel itself from closing.



"Andy" wrote:

I want to disable the close "X" icon on a workbook and worksheet. I have a
EXIT button on the worksheet aleady. Thanks for your help in advance!

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 414
Default disable the close "X" icon

OK! Thanks again!

"Patrick Molloy" wrote:

name a cell 'GoodToClose and set its value to FALSE

your exit button code should set this to TRUE

Add the following code to the code page of ThisWorkbook

Option Explicit
Private Sub Workbook_BeforeClose(Cancel As Boolean)
Cancel = Not (ThisWorkbook.Names.Item("GoodToClose").RefersToRa nge = True)
End Sub

The Cancel variable will be true, thus preventing the workbook closing if
the value of the range 'GoodToClose' is not set to TRUE
Note: This will also prevent Excel itself from closing.



"Andy" wrote:

I want to disable the close "X" icon on a workbook and worksheet. I have a
EXIT button on the worksheet aleady. Thanks for your help in advance!

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 414
Default disable the close "X" icon

Stefi, thanks very much!

"Stefi" wrote:

ToolsProtectionWorkbooks
Check the Window CheckBox
Stefi


€žAndy€ť ezt Ă*rta:

I want to disable the close "X" icon on a workbook and worksheet. I have a
EXIT button on the worksheet aleady. Thanks for your help in advance!

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Disable the "X" close button in an excel application Patrick Molloy[_2_] Excel Programming 3 April 19th 05 08:28 AM
Disable the "X" close button in an excel application keepITcool Excel Programming 1 April 18th 05 07:16 PM
Disable the "X" close button in an excel application keepITcool Excel Programming 1 April 18th 05 11:28 AM
Disable Close "X" button on User Forms Celtic_Avenger[_49_] Excel Programming 2 October 11th 04 06:20 PM
Disable "Save" &/or "Close" universal[_4_] Excel Programming 3 October 25th 03 12:38 PM


All times are GMT +1. The time now is 10:09 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"