Table of Contents

RDC00101 — Implicit declarations enabled

Severity: Warning  ·  Family: RDC (Rubberduck Core analyzers)  ·  Raised by: OptionExplicitAnalyzer

A module does not state Option Explicit.

Without it, a name that is not declared is not an error: a variable comes into being where it is used (MS-VBAL §5.2.1.3 Option Explicit Directive), so a misspelled name goes unnoticed and the program runs with a variable that nothing ever assigns. The diagnostic is an opinion of the analyzer and not a condition of the language: both are legal VBA.

Whether the module states Option Explicit is a fact the environment host vouches for (ModuleSemanticModel.OptionExplicit); the analyzer has nothing to say about a module the host has not analyzed, and does not guess from the syntax tree.

The fact is not issued for a language that has no such directive (SupportedLanguage.HasOptionExplicit): a BASIC, which an interactive shell is written in, has no way to state it, so a module of it is never reported as not stating it. VBA and VB6 have it.

How it is raised

Situation Resolution
The module has no Option Explicit directive. Add Option Explicit at the top of the module, and declare what it then reports.

See also


ACCUEIL • HOME | ℹ️ BIENVENUE • WELCOME | 🧩 BÂTISSONS • BUILD | RD-VBAL | SDK | 🌐 rubberduckvba.ca