K
Kriegler Johann
Can anybody solve following Problem?
Code:
For Each objVBProject As microsoft.Vbe.Interop.VBProject In
VBEInterop.VBProjects
For Each objComponent As microsoft.Vbe.Interop.VBComponent In
objVBProject.VBComponents
With objcomponent.CodeModule
Dim lngStartZeile As Integer = .CountOfDeclarationLines + 1
Do Until lngStartZeile >= .CountOfLines
Dim lngProcTyp As microsoft.Vbe.Interop.vbext_ProcKind Dim
strProcName As String= .ProcOfLine(lngStartZeile, lngproctyp)
<- Here is the Problem. Normally lngProctyp returns the "vbext_ProcKind"
but vb.net returns every time 0 (vbext_pk_Proc)->
The same Code in VBA does function correctly.
Dim lngBodyLine As Integer = .ProcBodyLine(strProcName, lngproctyp)
Dim lngProcCountLines As Integer = .ProcCountLines(strProcName, lngProcTyp)
lngStartZeile = lngStartZeile + lngProcCountLines
Loop
End With
Next
Next
Code:
For Each objVBProject As microsoft.Vbe.Interop.VBProject In
VBEInterop.VBProjects
For Each objComponent As microsoft.Vbe.Interop.VBComponent In
objVBProject.VBComponents
With objcomponent.CodeModule
Dim lngStartZeile As Integer = .CountOfDeclarationLines + 1
Do Until lngStartZeile >= .CountOfLines
Dim lngProcTyp As microsoft.Vbe.Interop.vbext_ProcKind Dim
strProcName As String= .ProcOfLine(lngStartZeile, lngproctyp)
<- Here is the Problem. Normally lngProctyp returns the "vbext_ProcKind"
but vb.net returns every time 0 (vbext_pk_Proc)->
The same Code in VBA does function correctly.
Dim lngBodyLine As Integer = .ProcBodyLine(strProcName, lngproctyp)
Dim lngProcCountLines As Integer = .ProcCountLines(strProcName, lngProcTyp)
lngStartZeile = lngStartZeile + lngProcCountLines
Loop
End With
Next
Next