| Author |
Message |
Matt W
Guest
|
Posted:
Thu Jan 13, 2005 1:05 am Post subject:
VBE CountOfLines... |
|
|
I'm trying to write a little program that will count the number of lines in
any sub, function, etc... but I can't seem to figure out the CountOfLines
portion.
Right now, it's giving me a count of ALL of the lines of code.
Here's what I've got so far...
Sub TEST()
Dim objVBE As VBIDE.VBE
Dim objProc As String
Dim lngSL As Long, lngSC As Long, lngEL As Long, lngEC As Long
Set objVBE = ThisDrawing.Application.VBE
Debug.Print objVBE.ActiveCodePane.CodeModule
objVBE.ActiveCodePane.GetSelection lngSL, lngSC, lngEL, lngEC
objProc = objVBE.ActiveCodePane.CodeModule.ProcOfLine(lngSL,
vbext_pk_Get)
Debug.Print objProc
Debug.Print objVBE.ActiveCodePane.CodeModule.CountOfLines
Set objVBE = Nothing
End Sub
Thanks in advance!
--
I support two teams: The Red Sox and whoever beats the Yankees.
|
|
| Back to top |
|
 |
fantum
Guest
|
Posted:
Thu Jan 13, 2005 2:09 am Post subject:
Re: VBE CountOfLines... |
|
|
Try
Debug.Print objVBE.ActiveCodePane.CodeModule.ProcCountLines(objProc, vbext_pk_Get) |
|
| Back to top |
|
 |
Matt W
Guest
|
Posted:
Thu Jan 13, 2005 2:18 am Post subject:
Re: VBE CountOfLines... |
|
|
No dice.
I get RT Error 35 "No Sub of Function Defined".
--
I support two teams: The Red Sox and whoever beats the Yankees.
"fantum" <nospam@address.withheld> wrote in message
news:27019366.1105564207299.JavaMail.jive@jiveforum1.autodesk.com...
| Quote: | Try
Debug.Print objVBE.ActiveCodePane.CodeModule.ProcCountLines(objProc,
vbext_pk_Get) |
|
|
| Back to top |
|
 |
Matt W
Guest
|
Posted:
Thu Jan 13, 2005 2:44 am Post subject:
Re: VBE CountOfLines... |
|
|
Figured it out...
It should be Debug.Print
objVBE.ActiveCodePane.CodeModule.ProcCountLines(objProc, vbext_pk_Proc)
instead.
--
I support two teams: The Red Sox and whoever beats the Yankees.
"Matt W" <nospam@address.withheld.com> wrote in message
news:41e5941b_3@newsprd01...
| Quote: | No dice.
I get RT Error 35 "No Sub of Function Defined".
--
I support two teams: The Red Sox and whoever beats the Yankees.
"fantum" <nospam@address.withheld> wrote in message
news:27019366.1105564207299.JavaMail.jive@jiveforum1.autodesk.com...
Try
Debug.Print objVBE.ActiveCodePane.CodeModule.ProcCountLines(objProc,
vbext_pk_Get)
|
|
|
| Back to top |
|
 |
fantum
Guest
|
Posted:
Thu Jan 13, 2005 2:50 am Post subject:
Re: VBE CountOfLines... |
|
|
| Unless you want the line count of a property procedure. |
|
| Back to top |
|
 |
|
|
|
|