Below is a quicky function that lets you determine at runtime whether the
code is compiled or you are running in the IDE.
Private Function IsTheCodeCompiled() As Boolean
On Error Resume Next
Debug.Print 1 / 0
IsTheCodeCompiled = IIf(Err, False, True)
End Function