I have the following lines of code among others in my database
- Dim modModule As CodeModule
-
Set modModule = Application.VBE.ActiveVBProject.VBComponents(strModule).CodeModule
-
lngStartLine = modModule.ProcStartLine(strProcedure, vbext_pk_Proc)
When this code runs, I'm getting an error message highlighting line 3 saying "Sub or Function not defined". If I hover over strProcedure, I get the proper value. If I hover over vbext_pk_Proc I get the value 0 (as I should). If I hover over the .ProcStartLine, it shows the same error. I have the reference set to Microsoft Visual Basic for Applications Extensibility 5.3. If I go to the Object Browser, it lists ProcStartLine as one of the properties of the CodeModule object. I even get intellisense for it. So why am I getting this error message? I have even tried removing the reference and setting it again. It works on another database, but not on this one. Any ideas?