Public Sub DeclareDLL()
Dim I As Boolean
I = False
Dim R As Reference
For Each R In References
If R.Name = "ADOX" Then I = True
Debug.Print R.Name
Next
If I = False Then 'ADOX引用丢失
MsgBox "ADOX引用不存在,即将加载"
Dim PathName As String
PathName = Application.CurrentProject.Path & "\"
Dim Library As String
Library = "*.dll" '你需要的dll文件
References.AddFromFile PathName & Library
End If
End Sub