动态添加引用示例: On Error Resume Next Dim REF As Reference Dim strfilename As String strfilename = "c:\program files\common files" & _ "\system\ado\msado21.tlb" 路径由引用窗体获得 Set REF = Application.References.AddFromFile(strfilename) 必须加APPLICATION MsgBox REF.Name & "已经被引用完毕" 获得应用名称的途径
动态删除引用示例: On Error Resume Next Dim REFE As Reference Set REFE = Application.references!ADODB 由 添加时的REF.NAME获得 Dim REF As String REF = REFE.Name Application.references.Remove REFE 必须加APPLICATION MsgBox REF & "已经被取消引用" 获得应用名称的途径