Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
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
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
how to track the number of user accessing an .xls file Jatin Excel Worksheet Functions 0 August 28th 07 10:26 AM
Tools...References shows "MISSING:" in front of 2 references Mike Jamesson Excel Programming 1 October 19th 05 06:33 PM
Missing References Dick Scratcher Excel Programming 4 September 10th 04 01:23 PM
References.Remove References(1) DOES NOT WORK for "MISSING:" Refs Jamie Carper[_2_] Excel Programming 0 May 27th 04 04:22 PM
MIssing References RJ Excel Programming 3 April 5th 04 04:02 AM


All times are GMT +1. The time now is 08:23 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"