Hi All,
I've been busy with a project to sort of protect my excell program, to the general user anyway. I have coded that when the sheet has been unptotected by a user that should not be unprotecting, then I delete the formulas in the cells, I was wondering if there is a way to immediately close the workbook on unprotect, instead of them having to change a cell first after unprotecting. In other words as soon as the user unprotects the sheet I would like to close the workbook immediately.
I have coded so far:-
Sub SheetIsProtected(oSheet As Worksheet)
With oSheet.UsedRange
If oSheet.ProtectContents = False _
Or oSheet.ProtectDrawingObjects = False _
Or oSheet.ProtectScenarios = False Then
UserForm3.Show
.Value = .Value
ActiveWorkbook.Save
Application.Quit
End If
End With
End Sub
Thanks in advance
Lee