Private Sub Command1_Click()
MsgBox App.LogMode '0=ide 1=exe
End Sub
注意:如果在 DLL 中(不是exe)使用 App.LogMode,如果你在 IDE 中调用这个DLL,会提示 在 EXE 中 而不提示在 IDE 中。
如果不是做 DLL 完全可以用简单高效的 App.LogMode。
更加好的办法:
Private Sub Command1_Click()
MsgBox f_CheckIDE
End Sub
Private Function f_CheckIDE() As Boolean
Debug.Assert f_MakeTrue(f_CheckIDE)
End Function
Private Function f_MakeTrue(ByRef blnualue As Boolean) As Boolean
blnualue = True
f_MakeTrue = True
End Function