I use the following code to save backup versions to a couple different external backup locations and to the original file. Sometime though either of the external backup drives is not connected and generates an error.
How can I skip to the next line of code to execute the other two saves? I will also be adding a message box when this happens.
Sub SaveToLocations()
' Saves active file to current plus two other backup locations, appends date and time in front of file name
Dim datim As String
datim = Format(CStr(Now), "yyyy_mm_dd_hh_mm_ss_")
ActiveWorkbook.SaveCopyAs "I:\FBackupCS\" & datim & ActiveWorkbook.Name
ActiveWorkbook.SaveCopyAs "E:\CS Docs\FBackupCS\" & datim & ActiveWorkbook.Name
ActiveWorkbook.Save
End Sub
You could use the following function
in your code like that