Inspection Details

MemberNotOnInterface


Summary
Warns about member calls against an extensible interface, that cannot be validated at compile-time.
Reasoning
Extensible COM types can have members attached at run-time; VBA cannot bind these member calls at compile-time. If there is an early-bound alternative way to achieve the same result, it should be preferred.
The following code example(s) would trigger this inspection:

Public Sub DoSomething(ByVal adoConnection As ADODB.Connection)
    adoConnection.SomeStoredProcedure 42
End Sub

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

Public Sub DoSomething(ByVal adoConnection As ADODB.Connection)
    Dim adoCommand As ADODB.Command
    Set adoCommand.ActiveConnection = adoConnection
    adoCommand.CommandText = "SomeStoredProcedure"
    adoCommand.CommandType = adCmdStoredProc
    adoCommand.Parameters.Append adocommand.CreateParameter(Value:=42)
    adoCommand.Execute
End Sub


Back to List