求助:添加引用
Sub 引用()'用VBA代码重新引用ADO
Dim REFE As References '声明REFE为引用
Dim strFileName As String '声明strFileName为文本型变量
Dim rf
Set REFE = Application.References
For Each rf In REFE '在引用中循环查找
If rf.Name = "ADODB" And (rf.IsBroken) = False Then
Application.References.Remove rf '移除
Exit For '退出循环
End If
Next
strFileName = "C:\Program Files\Common Files\System\ado\msado15.dll"
Set rf = Application.References.AddFromFile(strFileName) '重新引用
End Sub
这段代码在access中可以删除和添加引用
请问在vb中如何修改代码
[此贴子已经被作者于2017-5-18 11:40编辑过]