Private Declare Function FindWindowA Lib "User32" _
(ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Private Declare Function GetWindowLongA Lib "User32" _
(ByVal hwnd As Long, ByVal nIndex As Long) As Long
Private Declare Function SetWindowLongA Lib "User32" _
(ByVal hwnd As Long, ByVal nIndex As Long, _
ByVal dwNewLong As Long) As Long
_________________________________________________________________
Private Sub Workbook_BeforeClose(Cancel As Boolean)
Dim hwnd As Long
hwnd = FindWindowA(vbNullString, Application.Caption)
SetWindowLongA hwnd, -16, GetWindowLongA(hwnd, -16) Or &H80000
End Sub
__________________________________________________________________
Private Sub Workbook_Open()
Application.DisplayFullScreen = True
Application.EnableCancelKey = xlDisabled
Dim hwnd As Long
hwnd = FindWindowA(vbNullString, Application.Caption)
SetWindowLongA hwnd, -16, GetWindowLongA(hwnd, -16) And &HFFF7FFFF
ActiveWorkbook.Protect Structure:=False, Windows:=False
ActiveWindow.WindowState = xlMaximized
ActiveWorkbook.Protect Structure:=False, Windows:=True
If Sheets("Alerte").Range("H3") = "ALERTE" Or Range("j3") = "ALERTE" Or Range("l3") = "ALERTE" Or Range("m3") = "ALERTE" Or Range("n3") = "ALERTE" Then
UserForm1.Show
End If
End Sub