View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Mariano B. Mariano B. is offline
external usenet poster
 
Posts: 9
Default Have end user add missing references without accessing the vba pro

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.AddFrom File (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??



--
Mariano