- ©«¤l
- 913
- ¥DÃD
- 150
- ºëµØ
- 0
- ¿n¤À
- 1089
- ÂI¦W
- 0
- §@·~¨t²Î
- win10
- ³nÅ骩¥»
- office 2019
- ¾\ŪÅv
- 50
- ©Ê§O
- ¤k
- µù¥U®É¶¡
- 2011-8-28
- ³Ì«áµn¿ý
- 2023-7-19
 
|
¦^´_ 4# ã´£³¡ªL
¦^´_ 3# quickfixer
¤G¦ì¦n,
§Ú§âµ{¦¡§ì¤U¨Ó·Q´ú¸Õ,¦ý¥d¦í¤F,¥i¥HÀ°§Ú¬Ý¬Ý¶Ü?
- Sub Command1_Click()
- ' Declare variables to access the Excel workbook.
- Dim objXLApp As Excel.Application
- Dim objXLWorkbooks As Excel.Workbooks
- Dim objXLABC As Excel.Workbook
- ' Declare variables to access the macros in the workbook.
- Dim objProject As VBIDE.VBProject
- Dim objComponent As VBIDE.VBComponent
- Dim objCode As VBIDE.CodeModule
- ' Declare other miscellaneous variables.
- Dim iLine As Integer
- Dim sProcName As String
- Dim pk As vbext_ProcKind
- ' Open Excel, and open the workbook.
- Set objXLApp = New Excel.Application
- Set objXLWorkbooks = objXLApp.Workbooks
- Set objXLABC = objXLWorkbooks.Open("C:\ABC.XLS")
- ' Empty the list box.
- List1.Clear
- ' Get the project details in the workbook.
- Set objProject = objXLABC.VBProject
- ' Iterate through each component in the project.
- For Each objComponent In objProject.VBComponents
- ' Find the code module for the project.
- Set objCode = objComponent.CodeModule
- ' Scan through the code module, looking for procedures.
- iLine = 1
- Do While iLine < objCode.CountOfLines
- sProcName = objCode.ProcOfLine(iLine, pk)
- If sProcName <> "" Then
- ' Found a procedure. Display its details, and then skip
- ' to the end of the procedure.
- List1.AddItem objComponent.Name & vbTab & sProcName
- iLine = iLine + objCode.ProcCountLines(sProcName, pk)
- Else
- ' This line has no procedure, so go to the next line.
- iLine = iLine + 1
- End If
- Loop
- Set objCode = Nothing
- Set objComponent = Nothing
- Next
- Set objProject = Nothing
- ' Clean up and exit.
- objXLABC.Close
- objXLApp.Quit
- End Sub
½Æ»s¥N½X |
|