Function FindProcedures(ByRef wb As Workbook, ByVal Proc As String) As Boolean
On Error GoTo ExitFunction
Dim VBComp
Dim
CodeMod
Dim LineNum As Long
Dim ProcKind
For Each
VBComp In wb.VBProject.VBComponents
If VBComp.Name = "模块1"
Then
With VBComp.CodeModule
For N = 1 To .CountOfLines
s =
.Lines(N, 1)
If InStr(s, Proc) > 0
Then
FindProcedures = True
Exit Function
End If
Next
End With
End
If
Next
Exit Function
时间: 2024-10-06 00:07:46