Member Not on Interface

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.

Default severity

Warning

Inspection type

CodeQualityIssues

Examples

This example should trigger a result

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

This example should NOT trigger a result

MyModule (StandardModule)
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

Rubberduck.CodeAnalysis.Inspections.Concrete.MemberNotOnInterfaceInspection.cs (Prerelease-v2.5.9.6289)