|
楼主 |
发表于 2010-4-13 20:27
|
显示全部楼层
Sub ShowRefs()
Dim rf As VBIDE.Reference
For Each rf In ThisWorkbook.VBProject.References
Debug.Print rf.Name, rf.FullPath
Next
End Sub
-----------
结果:如下.
VBA C:\Program Files\Common Files\Microsoft Shared\VBA\VBA6\VBE6.DLL
Excel D:\Program Files\Microsoft Office\OFFICE11\EXCEL.EXE
stdole C:\WINDOWS\system32\stdole2.tlb
Office C:\Program Files\Common Files\Microsoft Shared\OFFICE11\MSO.DLL
VBIDE C:\Program Files\Common Files\Microsoft Shared\VBA\VBA6\VBE6EXT.OLB
ADODB C:\Program Files\Common Files\system\ado\msado15.dll
VBScript_RegExp_55 C:\WINDOWS\system32\vbscript.dll\3
msvbvm60.dll是个复杂的东西,他里面不但封装了很多API,也有很多类。但不是每一个类在程序中的应用的上,为了节省资源,所以对类进行了分组。比如msvbvm60.dll\0这个组保存了控件类(按钮,文本框等),msvbvm60.dll\3这个类保存了的vb绝大部分的函数。
http://topic.csdn.net/t/20061110/15/5148644.html#
Word D:\Program Files\Microsoft Office\OFFICE11\MSWORD.OLB
还有一个问题,在这个机器Excel和Word在D盘,如何知道另一个机器的Excel和Word的引用项目在哪里?需要在硬盘用文件搜索命令查找???
---------------- Sub ShowRefs()
- Dim rf As VBIDE.Reference
- kk = 2
- For Each rf In ThisWorkbook.VBProject.References
- With rf
- Sheet1.Cells(kk, 1) = .Name
- Sheet1.Cells(kk, 2) = .FullPath
- kk = kk + 1
- End With
- Next
- End Sub
- Sub noShowRefs()
- Dim rf As VBIDE.Reference, Str As String
- 'kk = 2
- On Error Resume Next
- With Sheet1
- nn1 = .Range("J2").End(xlDown).Row
- nn2 = .Range("J65536").End(xlUp).Row
- For kk = nn1 To nn2
- Str = .Cells(kk, 10)
- ThisWorkbook.VBProject.References.Remove ThisWorkbook.VBProject.References(Str)
- Next kk
- End With
- End Sub
- Sub AddRefs()
- Dim rf As VBIDE.Reference, Str As String
- 'kk = 2
- On Error Resume Next
- With Sheet1
- nn1 = .Range("K2").End(xlDown).Row
- nn2 = .Range("K65536").End(xlUp).Row
- For kk = nn1 To nn2
- Str = .Cells(kk, 11)
- ThisWorkbook.VBProject.References.AddFromFile Str
- Next kk
- End With
- End Sub
复制代码
[ 本帖最后由 ningyong58 于 2010-4-14 08:16 编辑 ] |
评分
-
1
查看全部评分
-
|