Public Function InIDE() As Boolean On Error Resume Next Err.Clear Debug.Assert 1 / 0 If Err.Number <> 0 Then Err.Clear InIDE = True Else Err.Clear End If End Function