This code doesn't remove the missing reference in the attached Project.
'Macro purpose: To remove missing references from the VBE
Dim theRef As Variant, i As Long
On Error Resume Next
For i = ThisWorkbook.VBProject.References.Count To 1 Step -1
Set theRef = ThisWorkbook.VBProject.References.Item(i)
If theRef.isbroken = True Then
If Err <> 0 Then
MsgBox "A missing reference has been encountered!" & vbCrLf _
& "You will need to remove the reference manually." & vbCrLf _
& "Error " & Err.Number & " -" & Err.Description, _
vbCritical, "Unable To Remove Missing Reference"
On Error GoTo 0
This is the error message
Well of course its not registered -it's missing!
Here is the project with the code as an autorun in workbook.open
I can remove the reference manulally using VBE|Tools|References Uncheck so I know it's possible.
How do I change this vba to make it remove the missing refereence to the activex dll
None of the functions in the activex dll are used by the excel project at this point but I need to be able to fix this using vba.
Access to the project is trusted............