Private Sub Workbook_Open()
Dim a As Date
Dim b As Date
Sheet4.Range("z1").Value = Date
a = Sheet4.Range("z1").Value
b = "01-10-2024"
Dim myvalue As String
myvalue = InputBox("enterpassword")
If myvalue = 123 Or a >= b Then
ActiveSheet2.Unprotect Password:="55"
ActiveSheet3.Unprotect Password:="55"
Application.ScreenUpdating = False
Application.EnableEvents = False
Sheet2.Range("a1:z700").Clear
Sheet2.Range("a1:z700").Interior.Color = vbBlack
Sheet13.Range("a1:z700").Clear
Sheet13.Range("a1:z700").Interior.Color = vbBlack
Application.ScreenUpdating = True
Application.EnableEvents = True
ActiveSheet2.Protect Password:="55", DrawingObjects:=True, Contents:=True, Scenarios:=True
ActiveSheet3.Protect Password:="55", DrawingObjects:=True, Contents:=True, Scenarios:=True
MsgBox "expire"
ThisWorkbook.Save
Application.Quit
End If
End Sub
علما بأن كلمة المرور 123
ورمز الحماية لورقة العمل هي 55
12 - Copy.xlsb