Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have the line below in a module:
Public NoSave As Boolean In my Auto_Open routine I have: Sub Auto_Open() ' Events.Enable_Events If ActiveWorkbook.ReadOnly = True Then NoSave = True Protection.ProtectAllSheets Else NoSave = False Protection.UnProtectAllSheets End If Module7.StartPoint Module6.StartTimer End Sub Then I in ThisWorkbook ihave the following" Private Sub Workbook_BeforeClose(Cancel As Boolean) If NoSave = True Then ThisWorkbook.Close False End If If NoSave = False Then End If End Sub My problem is that when you click on either the Red X to close Excel or the smaller X to close the workbook you are still prompted to save the workbook. So it is not seeing NoSave as true, even when it was set to True in te Auto_Open routine. |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Public variable (or Public Const?) | Excel Programming | |||
Public variable (or Public Const?) | Excel Programming | |||
Problem with Public Variable value being changed. | Excel Programming | |||
strange problem with public variable | Excel Programming | |||
Public variable problem | Excel Programming |