Deleting Sheet with VBA crashes Excel
问题 I am trying to delete a worksheet when the user click's on an image (button) in Excel. However this makes excel crash and restart, forgetting any unsaved progress. This is my sub: Sub DeletePlan() Application.Calculation = xlCalculationManual Application.DisplayAlerts = False Dim SheetNamesToCopy As String SheetNamesToCopy = ActiveSheet.Name ' Check what addon sheets exists for the media, then add existing ones to string If CheckSheet("periodeplan", True) = True Then ThisWorkbook.SheetS