Ejemplo 1: cierre de Excel vba sin guardar
ActiveWorkbook.Close savechanges:=False
Ejemplo 2: excel vba evitar guardar el libro de trabajo
Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
Cancel = True ' Cancels in any case
' Or :
If SaveAsUI Then Cancel = True ' Cancels only if saving is asked by user, not via code
End Sub
' Prevents Excel from requesting a save before closing
Private Sub Workbook_BeforeClose(Cancel As Boolean)
Application.ThisWorkbook.Saved = True
End Sub
¡Haz clic para puntuar esta entrada!
(Votos: 0 Promedio: 0)