Inspection Details

IsMissingOnInappropriateArgument


Summary
Identifies uses of 'IsMissing' involving non-variant, non-optional, or array parameters.
Reasoning
'IsMissing' only returns True when an optional Variant parameter was not supplied as an argument. This inspection flags uses that attempt to use 'IsMissing' for other purposes, resulting in conditions that are always False.
The following code example(s) would trigger this inspection:

Public Sub DoSomething(ByVal foo As Long = 0)
    If IsMissing(foo) Then Exit Sub ' condition is always false
    ' ...
End Sub

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

Public Sub DoSomething(Optional ByVal foo As Variant = 0)
    If IsMissing(foo) Then Exit Sub
    ' ...
End Sub


Back to List