Public Cierre As String Sub CerrarArchivo() Cierre = "SI" ActiveWorkbook.Close SaveChanges:=True End Sub
Private Sub Workbook_BeforeClose(Cancel As Boolean) If Cierre <> "SI" Then Cancel = True MsgBox "Modo de cierre no permitido..." End If End Sub