Can I have an macro which will stop the Auto_Close macro from running.
And Is there any macro to delete the module of an opened workbook??
Sub DisableEvents()
Application.EnableEvents = False
ThisWorkbook.Close
End Sub
Sub Auto_close()
MsgBox "Hello"
End Sub
First, auto macros (open & close) aren't really event procedures, I don't think enabling or disabling the events prevents these macros from running. However, Auto macros do not run if a file is being opened or closed via vba (another macro). Also, if you're opeing or closing the file manually, hold your shift key, this will disable the macros.