Implicit Containing Workbook Reference
Locates unqualified Workbook.Worksheets/Sheets/Names member calls inside workbook document modules, that implicitly refer to the host workbook.
Reasoning
Implicit references inside a workbook document module can easily be mistaken for implicit references to the active workbook (ActiveWorkbook), which is the behavior in all other module types. By explicitly qualifying these member calls with 'Me', the ambiguity can be resolved. If the intent is to actually refer to the active workbook, qualify with 'ActiveWorkbook' to prevent a bug.
Default severity
Warning
Inspection type
CodeQualityIssues
Examples
This example should trigger a result
This example should NOT trigger a result
Rubberduck.CodeAnalysis.Inspections.Concrete.ImplicitContainingWorkbookReferenceInspection.cs (Prerelease-v2.5.9.6289)