Application.DisplayAlerts = False
On Error Resume Next
On Error Goto 0
Application.DisplayAlerts = True
- The code between "On Error Resume Next" and "On Error Goto 0" will be skipped if an error is generated.
- It also won't display the error to the user because of the code on line 1 (Application.DisplayAlerts = False).
- "ThisWorkbook" will need to be declared.