Inspection Details

SuspiciousLetAssignment


Summary
Identifies assignments without Set for which both sides are objects.
Reasoning
Whenever both sides of an assignment without Set are objects, there is an assignment from the default member of the RHS to the one on the LHS. Although this might be intentional, in many situations it will just mask an erroneously forgotten Set.
The following code example(s) would trigger this inspection:

Public Sub DoSomething(ByVal rng As Excel.Range, ByVal arg As ADODB Field)
    rng = arg
End Sub

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

Public Sub DoSomething(ByVal rng As Excel.Range, ByVal arg As ADODB Field)
    rng.Value = arg.Value
End Sub

Public Sub DoSomething(ByVal rng As Excel.Range, ByVal arg As ADODB Field)
    Let rng = arg
End Sub


Back to List