
ProcName = CodeMod.ProcOfLine(i, vbext_pk_Proc) ' and any module-level variable declations.įor i = CodeMod.CountOfDeclarationLines + 1 To CodeMod.CountOfLines ' Returns collection of all vbeProcedures in a CodeModule ' Private Function getProcedures(CodeMod As CodeModule) As VbeProcedures Set mVbeProcedures = getProcedures(mCodeModule) Public Sub Initialize(CodeMod As CodeModule) Public Property Let CodeModule(ByRef CodeMod As CodeModule) Public Property Get CodeModule() As CodeModule The project requires references to both the Microsoft Visual Basic for Applications Extensibility 5.3 and Microsoft Access 14.0 Object libraries. vbeCodeModule - Ties the VBIDE.CodeModule object to a vbeProcedures collection (as well as actually creating that collection.).vbeProcedures - Simple collection class that holds only the vbeProcedure type.vbeProcedure - does most of the heavy lifting of getting us the procedures.

I feel like I have the logic and style pretty tight, so I'm particularly interested in hearing thoughts on how I handled the object model. I'd like to gauge if I've learned anything over the last few days here. Of course, I'm also interested in other feedback. I decided to write a few class modules to make it easier.Ĭonsidering this can be kind of dangerous to do, I want to know that it's working the way I think it does without unintended side effects. The Microsoft Visual Basic for Applications Extensibility library let's us meta-program VBA, but the way it handles (or rather, doesn't handle) getting to the actual subs and functions is clunky at best.
