Object Libraries

DJ100

Registered User.
Local time
Today, 08:16
Joined
Jul 4, 2002
Messages
34
Looking for some help . . .

I have a VBA project in Excel which is used by several people on my network. As the main spreadsheet can change I save it on our fileserver and each morning the machines automatically make a local copy for use that day.

The problem I have is that I have several 'flavours' of office on my network - Office XP and Office 2003 being the main ones. I am the network administrator and naturally(!) I have the most up to date machine and I make any changes . .. my problem (that word again) is that I have the Office 11 Object Libraries and most of the machines have the Office 10 Object Libraries . . . when I make any changes the references are changed to Office 11 libraries . . .

Is there anything I can do to stop this??? I have tried putting the Office 10 Libraires on my machine but this doesn't help . . .

Any suggestions (other than upgrading all the machines!) would be gratefully received
 
I had the same problem... and I think there is probably a better way out there, I just don't know about it. But I will get the code I made to determine which reference to use.
 
All it does is check what version of outlook is running and loads the reference to the file (if the file exists).

I also just added in a basic userlog... and basic feature to see who's signed in or not (view them it by looking at a table).

The best way to understand this is to go to the VBE and look at the code for the forms... beginning with the opening form. Then just step through the code and look at what it does.


Edit:
To tell you the truth, the Office references should be defaulted to the application that's calling it. Meaning, if you close a file with a Office 11 reference. And then you open the file from a Office 10 machine, the app should open with the Office 10 library automatically.

Again, the database shows how to make (and remove) a reference depending on what version of office they have.

Edit2:
Nevermind... it's only the Access/VBA reference that is defaulted.



<Attachment removed. New Attachment added in post below>
 
Last edited:
I forgot something.

Include this in the mdl_Load/Unload

Code:
Public Function UnloadExtraReferences()
On Error GoTo err_Log
    Dim ref
    For Each ref In Application.References
        If ref.Name <> "VBA" And ref.Name <> "Access" Then
            Debug.Print "Removing " & ref.Name
            Application.References.Remove ref
        End If
    Next
    
'-----------------------------
'EXIT/ERROR MESSAGES BELOW
'-----------------------------
ext_Function:
    Exit Function
err_Log:
    If Err.Number <> 57101 Then
        LogError
    End If
    Resume Next
End Function

And place UnloadAllReferences on the next line under the 'Unload --- in the Form_Close() event for your Login-Logout form.

This is really important because it gets rid of the references when you close. If you don't include this, the error will still come up on a machine that uses the other files.

I'll attach the changes.
 

Attachments

DJ100 said:
Is there anything I can do to stop this??? I have tried putting the Office 10 Libraires on my machine but this doesn't help

Did you make sure to register your .dll files?

Start Menu -> Run -> type: regsvr32 "C:\full path\dll_file.dll"
 

Users who are viewing this thread

Back
Top Bottom