Table of Contents

RDC00125: Suspicious Let assignment

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

An object is assigned to an object without Set.

Without Set, the assignment is a Let (RD-VBAL §5.4.3.8 Let Statement): VBA reads the value of the default member of the object on the right, and assigns it to the default member of the object on the left. Both variables keep the objects they hold. Assigning the object itself takes Set (RD-VBAL §5.4.3.9 Set Statement), and code like this is more often a missing Set than a copy of the values.

The finding is the assignment.

How it is raised

Situation Example Resolution
An object assigned to an object, without Set. target = source, both declared As Cell Set target = source to assign the object; or target.Value = source.Value if the values are meant.

See also


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