Hello all, and TIA.
I have been using #1 below to turn off alerts before deleting a worksheet, but started to get the warning anyway. I found the other methods I've listed below, and think I understand #1 & #2.
#1 is to the worksheet object and will revert to DisplayAlerts = True when the module closes.
#2 is to the workbook object and will remain set until re-set or the workbook is closed.
So #2 is probably my best option for not getting a warning before deleting a worksheet. Because workbook is an object, do I need to reset events for a save as to an .xlsx?
I don't understand what if any difference there is with #3 & #4. And am happy to learn of any others. Can someone please explain what are the differences in these options for turning off Alerts? Possible best practice for this scenario?
Ron
I have been using #1 below to turn off alerts before deleting a worksheet, but started to get the warning anyway. I found the other methods I've listed below, and think I understand #1 & #2.
#1 is to the worksheet object and will revert to DisplayAlerts = True when the module closes.
#2 is to the workbook object and will remain set until re-set or the workbook is closed.
So #2 is probably my best option for not getting a warning before deleting a worksheet. Because workbook is an object, do I need to reset events for a save as to an .xlsx?
I don't understand what if any difference there is with #3 & #4. And am happy to learn of any others. Can someone please explain what are the differences in these options for turning off Alerts? Possible best practice for this scenario?
-
VBA Code:
With Application .DisplayAlerts = False End With ' Application
-
VBA Code:
ThisWorkbook.NoEvents = True
-
VBA Code:
xl.DisplayAlerts = False
-
VBA Code:
app.DisplayAlerts = False
Ron