Application.References.Remove fails

T

Thor

If I copy a database which references the msadox.dll from
mdac 2.7 to a computer with an earlier version of mdac I
get a compile error. When I try to run code to remove
this reference I get an error 'Object library not
registered'. Is there a way to remove this broken
reference so that I can add a reference to the msadox.dll
from the earlier mdac version?
 
D

Douglas J. Steele

What does your code look like? (This isn't an MDE, is it? You can't change
references in an MDE)
 
D

Douglas J. Steele

See whether

For Each refItem In Application.References
If refItem.IsBroken Then
Application.References.Remove refItem
End If
Next refItem

works
 
T

Thor

Same error. If I copy the database to a computer with
msadox.dll v2.5 or 2.6 that has Microsoft Access loaded I
can uncheck the 2.7 reference and select the 2.5
reference. But on the same computer doing this through
code fails. If I uncheck the 2.7 reference in the
References dialog then I can add the new reference through
code, but no luck removing it through code.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top