Table of Contents

VBC09316 — Method or data member not found

Severity: Error  ·  Family: VBC (static semantics / abstract syntax tree)  ·  Source metadata: VBCompileErrorInfo

A member is accessed on a type that is known not to have it.

The member names a method or a data member the type does not declare. MS-VBA reports the same error, at compile time and at run time: Method or data member not found. The run-time error is VBR00461.

This code is raised by MemberAccessExpressionStaticSemantics, IndexExpressionStaticSemantics, DictionaryAccessExpressionStaticSemantics.

How it is raised

Situation Example Resolution
A member is accessed that the class, module or type does not have. widget.NoSuch where widget is a Widget that has no NoSuch Use a member it has. A member of a type that is open to extension (a host object) is not an error.
A ReDim re-dimensions a member of an object whose class is declared, whatever the member is - a public variable, a property - and in a With block too. Dim w As Widget … ReDim w.Items(1 To 3) Give the class a procedure that re-dimensions its own array, and call it.

Notes

MS-VBA reports a ReDim of a member of an object with this error when the object's class is declared, and with VBC09306 Invalid ReDim when it is declared As Object (recorded in Excel). The member is not missing: a ReDim re-dimensions a variable of the code's own, which an object's member is not.

🧩 A language-level extension could allow re-dimensioning an object's array through the object in the future; RD-VBA does what MS-VBA does. See VBC09306.

See also


⏮️ VBC09315 Exit Property not allowed in Sub or Function | ⏭️ VBC09317 Invalid use of Me


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