Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
If I have a class module and within that module I have the following line of
code: Public Property Get Name() As String Name = pName End Property In a regular module I can use the following code to extract the name of the "sub" and pass it to the variable "ProcName" For Each VBComp In ThisWorkbook.VBProject.VBComponents ModuleName = VBComp.Name NumLines = 0 With VBComp.CodeModule myStartLine = .CountOfDeclarationLines + 1 While myStartLine < .CountOfLines SubFuncCount = SubFuncCount + 1 ProcName = .ProcOfLine(myStartLine, vbext_pk_Proc) NumLines = .ProcCountLines(ProcName, vbext_pk_Proc) myStartLine = myStartLine + NumLines Wend End With Next ?ProcName Name Note the use of "vbext_pk_Proc" in: ProcName = .ProcOfLine(myStartLine, vbext_pk_Proc) However the code fails on: NumLines = .ProcCountLines(ProcName, vbext_pk_Proc) I know from Chip Pearson's site that: vbext_pk_Get (3). A Property Get procedure. vbext_pk_Let (1). A Property Let procedure. vbext_pk_Set (2). A Property Set procedure. vbext_pk_Proc (0). A Sub or Function procedure. Why does vbext_pk_Proc work in the first instance but not the second? Thanks EM |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Class modules: parametrize class object fields | Excel Programming | |||
Basic question - modules and class modules - what's the difference? | Excel Programming | |||
Class Modules vs Modules | Excel Programming | |||
Class Modules | Excel Programming |