Hello everyone. Hey, is there anyway to determine, using code, whether I'm running within the IDE or not? Thanks for listening.
Printable View
Hello everyone. Hey, is there anyway to determine, using code, whether I'm running within the IDE or not? Thanks for listening.
Code:Option Explicit
' Flag for debug mode
Private mbDebugMode As Boolean
' Set mbDebugMode to true. This happens only
' if the Debug.Assert call happens. It only
' happens in the IDE.
Private Function InDebugMode() As Boolean
mbDebugMode = True
InDebugMode = True
End Function
' Set the mbDebugMode flag.
Private Function InIDE()
' This will only be done if in the IDE
Debug.Assert InDebugMode
If mbDebugMode Then
InIDE = True
End If
End Function
Private Sub Form_Load()
' See if we are running in the IDE.
If InIDE Then
MsgBox "In the development environment"
Else
MsgBox "In a compiled executable"
End If
End Sub