O
ordnance1
I have the line below in a module:
Public NoSave As Boolean
In my Autpen routine I have:
Sub Autpen()
'
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
Autpen routine.
Public NoSave As Boolean
In my Autpen routine I have:
Sub Autpen()
'
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
Autpen routine.