Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Have end user add missing references without accessing the vba pro
Hi Mariano
You can use late binding See the info on the bottom of this outlook example http://www.rondebruin.nl/mail/folder2/mail1.htm Read the info on Dick's site also -- Regards Ron de Bruin http://www.rondebruin.nl "Mariano B." wrote in message ... 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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
how to track the number of user accessing an .xls file | Excel Worksheet Functions | |||
Tools...References shows "MISSING:" in front of 2 references | Excel Programming | |||
Missing References | Excel Programming | |||
References.Remove References(1) DOES NOT WORK for "MISSING:" Refs | Excel Programming | |||
MIssing References | Excel Programming |