Pages

5/12/2019

How to Close Excel without Prompting Dialogue

ALT + F11, insert a new module.



VBA: Close without Saving


Sub Auto_Close()

    ThisWorkbook.Saved = True

End Sub

VBA: Close with saving.


Sub Auto_Close()
    If ThisWorkbook.Saved = False Then
        ThisWorkbook.Save
    End If
End Sub