'列出引用項目
Sub Test_Ref()
Dim vRef As Object
With ThisWorkbook.VBProject
For Each vRef In .References
MsgBox "【名稱】" & vRef.Name & vbCrLf & "【路徑】" & UCase(vRef.FullPath)
Next
End With
End Sub
'移除引用項目
Sub Remove_Ref()
Dim vRef As Object
With ThisWorkbook.VBProject
For Each vRef In .References
If UCase(vRef.FullPath) = UCase("C:\WINDOWS\system32\FM20.DLL") Then
.References.Remove vRef
End If
Next
End With
End Sub作者: Scott090 時間: 2016-12-4 14:30