Have end user add missing references without accessing the vba pro

M

Mariano B.

I use Office 2003 but most of the end-users for my application have office XP.

The application uses the outlook object library. the problem is that since I
have office 2003, it references version 11 of the library. I have the
following code to try to avoid this problem.

Private Sub ReferenciaXP()
Dim str As String
Dim v As Integer
Dim i As Integer
Set Refs = Application.VBE.VBProjects(1).References
v = Application.Version
If v < 10 Then
MsgBox "Esta aplicación solo esta hecha para Office XP o superior",
vbInformation + vbOKOnly, "xMedios"
ActiveWorkbook.Close
Else
If v = 10 Then
For i = 1 To Refs.Count
If Refs(i).IsBroken And Refs(i).name = "Outlook" Then
Application.VBE.VBProjects(1).References.Remove Refs(i)
End If
Next i
str = Application.Path & "\msoutl.olb"
Application.VBE.ActiveVBProject.References.AddFromFile (str)
End If
End If

End Sub


But it does not work on all machines.
Sometimes the user is missing more references that are needed. I'd like it
if there was a way that the user could add the missing references without
having access to the proyect.

Any ideas??
 

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