Private Sub CmdAnnuler_Click()
Dim vbProj As VBProject
Dim chkRef As Reference
Set vbProj = ThisWorkbook.VBProject
For Each chkRef In vbProj.References
If chkRef.Name = "CDO" Or chkRef.Name = "DAO" Or chkRef.Name = "SHDocVw" Or chkRef.Name = "Outlook" _
Or chkRef.Name = "MSScriptControl" Or chkRef.Name = "Scripting" Or chkRef.Name = "Shell32" _
Or chkRef.Name = "VBScript_RegExp_55" Or chkRef.Name = "WIA" Or chkRef.Name = "Word" _
Or chkRef.Name = "ADODB" Or chkRef.Name = "ADOR" Or chkRef.Name = "ADOX" Then
vbProj.References.Remove chkRef
End If
Next
Set vbProj = Nothing
'Pour les références manquantes : If chkRef.IsBroken Then vbProj.References.Remove chkRef
End Sub