How to check if the program is in debug mode using VBA. Below code is used to check :-
Sub Check_VBA_VBE()
Dim oVBe As VBProject
Set oVBe = ThisWorkbook.VBProject
If oVBe.Mode = vbext_vm_Run Then
MsgBox "Executing.."
MsgBox oVBe.VBE.MainWindow.Visible
End If
End Sub
The code uses VBProject. Ensure that the Microsoft Visual Basic for Applications reference is loaded.
No comments:
Post a Comment