Home |
Search |
Today's Posts |
#1
![]() |
|||
|
|||
![]()
I have found code to prevent closure of an application by clicking on the Red X. I placed it on Thisworkbook & it prevents the user from closing by clicking on the Red X.
Here is the code as written at present: Private Sub Workbook_BeforeClose(Cancel As Boolean) If CloseMode = 0 Then Cancel = True MsgBox "The X is disabled, please click on the Exit button.", vbCritical End If End Sub This code is also preventing closure of the workbook/application. I think that once the code runs it is not released, I have not found a solution. I see the code working this way. The user clicks on the X & the above message, pops up & that is the end of the process. The user clicks on Exit & it closes. I do have working code to close the workbook/application. However when the Exit button is clicked at present it goes back to the above code. Something weird is going on . I went back in to the application, Clicked the X, & the message popped up once, & waited for me to respond. Last edited by FrancisM : June 25th 19 at 12:38 PM Reason: Recent change in operation |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Hyperlink to cell and have it appear at top upper left hand corner | New Users to Excel | |||
Moving Active Cell to Upper Left Hand Corner of Screen | Excel Programming | |||
The 'X' in the upper right hand corner is suddenly dithered? Help | Excel Discussion (Misc queries) | |||
What does a small green triangle in the upper left hand corner of. | Excel Discussion (Misc queries) |