Automatically updating/relinking certain references?

Ok, this correctly iterates through them all:

Code:
x = 1
 
For Each myref In a.References
    If a.References.Item(x).IsBroken = True Then
        a.References.Remove (SOMETHING)
    Else
        Debug.Print a.References.Item(x).FullPath
    End If
 
    x = x + 1
Next myref
What is the "something" i should put here? It wantes type "reference" there but replacing SOMETHING with a.References.Item(x) doesn't work

Maybe try this.
Code:
x = 1
 
For x = 1 to a.References.Count
    If a.References.Item(x).IsBroken = True Then
        set myref = a.References(x)
        a.References.Remove (myref)
    Else
        Debug.Print a.References.Item(x).FullPath
    End If
Next x
 
It's not a BuiltIn reference is it?
 
I don't know what that is.

In this case I am trying to remove Office library version 12.0 and adding Office library version 11.0 (mso.dll)
 
Maybe try a simple approach to start


Dim ref As Reference
Set ref = a.References![Office]
a.References.Remove ref
 
error : "Your Microsoft Office Access database or project contains a missing or broken reference to the file 'MSO.DLL' version 2.4.
 
Apparently the code is trying to compile before you're able to check or change references, it would seem this can't be done through VBA on a remote database that has a missing reference.
 
You could try writing a simple autoexec macro to run some code that deletes and creates the references you need, from a module, then export both the macro and module to each database from your database version.
David
 

Users who are viewing this thread

Back
Top Bottom