OK c'est good, je suis passé après le
Unload
par un
ThisWorkbook.Close True
. Le tout en changeant légèrement le
Sub Workbook_BeforeClose
ce qui donne
Private Sub Workbook_BeforeClose(Cancel As Boolean)
Application.DisplayAlerts = False
If ThisWorkbook.ReadOnly Then
If Workbooks.Count = 1 Then
Application.Quit
Else
Application.Visible = True
Me.Close False
End If
Else
If Workbooks.Count = 1 Then
Me.Save
Application.Quit
Else
Application.Visible = True
Me.Save
End If
End If
End Sub
Et cette fois toutes les manip fonctionnent bien, bon pas 100% propre car lors le
Application.Visible
lance un petit jeu de fenêtres un peu moche mais on s'en contentera