Inspection Details

OptionExplicit


Summary
Flags modules that omit Option Explicit.
Reasoning
This option makes variable declarations mandatory. Without it, a typo gets compiled as a new on-the-spot Variant/Empty variable with a new name. Omitting this option amounts to refusing the little help the VBE can provide with compile-time validation.
The following code example(s) would trigger this inspection:

Public Sub DoSomething()
    ' ...
End Sub

The following code example(s) would not trigger this inspection:

Option Explicit
Public Sub DoSomething()
    ' ...
End Sub


Back to List