Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Problem with vbext_pk_Proc
I am having trouble running the following (CPearson's) code. Sub ListProcedures() Dim VBCodeMod As CodeModule Dim StartLine As Long Dim Msg As String Dim ProcName As String Set VBCodeMod ThisWorkbook.VBProject.VBComponents("SaveModule"). CodeModule With VBCodeMod StartLine = .CountOfDeclarationLines + 1 Do Until StartLine = .CountOfLines Msg = Msg & .ProcOfLine(StartLine, *vbext_pk_Proc*) & Chr(13) StartLine = StartLine + _ .ProcCountLines(.ProcOfLine(StartLine, _ *vbext_pk_Proc), * *vbext_pk_Proc*) Loop End With MsgBox Msg End Sub Excel balks at vbext_pk_Proc. In the past, when some such problem wa encountered, I squirmed out of trouble by using the numerical constan values - as in using 1 for vbext_ct_stdModule, 100 fo vbext_ct_document etc. The Help files do not seem to give the numeri constant for vbext_pk_Proc. Any help will be appreciated -- david ----------------------------------------------------------------------- davidm's Profile: http://www.excelforum.com/member.php...fo&userid=2064 View this thread: http://www.excelforum.com/showthread.php?threadid=39028 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Problem with vbext_pk_Proc
In tools=references in the VBE, create a reference to the Microsoft Visual
Basic Extensibility library. I believe this is stated at the top of Mr. Pearson's web page. -- Regards, Tom Ogilvy "davidm" wrote in message ... I am having trouble running the following (CPearson's) code. Sub ListProcedures() Dim VBCodeMod As CodeModule Dim StartLine As Long Dim Msg As String Dim ProcName As String Set VBCodeMod = ThisWorkbook.VBProject.VBComponents("SaveModule"). CodeModule With VBCodeMod StartLine = .CountOfDeclarationLines + 1 Do Until StartLine = .CountOfLines Msg = Msg & .ProcOfLine(StartLine, *vbext_pk_Proc*) & Chr(13) StartLine = StartLine + _ ProcCountLines(.ProcOfLine(StartLine, _ *vbext_pk_Proc), * *vbext_pk_Proc*) Loop End With MsgBox Msg End Sub Excel balks at vbext_pk_Proc. In the past, when some such problem was encountered, I squirmed out of trouble by using the numerical constant values - as in using 1 for vbext_ct_stdModule, 100 for vbext_ct_document etc. The Help files do not seem to give the numeric constant for vbext_pk_Proc. Any help will be appreciated. -- davidm ------------------------------------------------------------------------ davidm's Profile: http://www.excelforum.com/member.php...o&userid=20645 View this thread: http://www.excelforum.com/showthread...hreadid=390287 |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Problem with vbext_pk_Proc
Try setting a reference (Tools - Reference) to the Microsoft Visual Basic
for Extensibility Library. Hit F2 for the object browser and you can search or browse through the constant definitions. In the object browser, choose VBIDE as the library and look for vbext_ProcKind as the Type. It's zero, by the way. -- Dick Kusleika Excel MVP Daily Dose of Excel www.dicks-blog.com davidm wrote: I am having trouble running the following (CPearson's) code. Sub ListProcedures() Dim VBCodeMod As CodeModule Dim StartLine As Long Dim Msg As String Dim ProcName As String Set VBCodeMod = ThisWorkbook.VBProject.VBComponents("SaveModule"). CodeModule With VBCodeMod StartLine = .CountOfDeclarationLines + 1 Do Until StartLine = .CountOfLines Msg = Msg & .ProcOfLine(StartLine, *vbext_pk_Proc*) & Chr(13) StartLine = StartLine + _ ProcCountLines(.ProcOfLine(StartLine, _ *vbext_pk_Proc), * *vbext_pk_Proc*) Loop End With MsgBox Msg End Sub Excel balks at vbext_pk_Proc. In the past, when some such problem was encountered, I squirmed out of trouble by using the numerical constant values - as in using 1 for vbext_ct_stdModule, 100 for vbext_ct_document etc. The Help files do not seem to give the numeric constant for vbext_pk_Proc. Any help will be appreciated. |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Problem with vbext_pk_Proc
Many thanks Tom and Dick. I am home and hosed; it's working now -- david ----------------------------------------------------------------------- davidm's Profile: http://www.excelforum.com/member.php...fo&userid=2064 View this thread: http://www.excelforum.com/showthread.php?threadid=39028 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Colon at the end of excel file name(ex: problem.xls:1, problem.xls | New Users to Excel | |||
Started out as an Access problem. Now an Excel problem | Excel Discussion (Misc queries) | |||
problem with a conditional max problem | Excel Discussion (Misc queries) | |||
Problem when multipple users access shared xl-file at the same time, macrocode for solve this problem? | Excel Programming |