Good morning, I have a worksheet that has a couple of buttons on it, has a window_activate event, worksheet_change event and enableevents is set to false in both events. I have a simple macro (below) that is used to delete the worksheet. However when invoked, it crashes Excel on the "ActiveSheet.Delete" line. After some trial and error, the macro will delete the sheet without crashing excel after the buttons are removed from the worksheet and all code is removed from the worksheet including the commandbutton_click events, worksheet_activate event and worksheet_change event. However I can manually delete the sheet by right clicking on the sheet tab and selecting delete with no issues. Seems buggy to me.
Has anyone come across this issue and found a good resolution or workaround? Maybe code that deletes the sheet code and buttons before deleting the sheet? Or possibly something else?

Sub deletesheet()
Application.EnableEvents = False
Application.ScreenUpdating = False
Application.DisplayAlerts = False
   
        ActiveSheet.Delete
    
Application.DisplayAlerts = True
Application.ScreenUpdating = True
Application.EnableEvents = True
End Sub
Thanks in advance.
Gary