Add the following code in your sub or function
On Error GoTo ErrHandler:
'your code will be here
Exit Sub
ErrHandler:
If err.Number = -2147467259# Then
MsgBox "Map Sheet is not found in selected workbook"
Else
MsgBox err.Description
End If
End Sub
On Error GoTo ErrHandler:
'your code will be here
Exit Sub
ErrHandler:
If err.Number = -2147467259# Then
MsgBox "Map Sheet is not found in selected workbook"
Else
MsgBox err.Description
End If
End Sub
No comments:
Post a Comment