Removing broken references

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have an application that adds a references to MS Outlook Object Library.
Depending on pc the file us used on I need references to different versions
of the reference. For instance 11.0 at work but 9.0 at home. I can not add
9.0 if there already exist a reference to 11.0, even if the reference to 11.0
is broken.

How can I write the code to remove a broken reference?

There is no problem adding a new reference if it not there to begin with.

Thanks in advance
 
Save yourself the headache and remove the reference permanently. Use late
binding instead...see help for CreateObject/GetObject.
 
I solved the first problem but I didn't get late binding correct. Now the
process sending mail from Excel doesn't work. My first choice would be to be
able to remove broken references via VB.
 
Paul's right that late binding is the appropriate solution to your problem,
not adding and removing references.

What's the problem you're encountering with late binding? There are really
only four things you should have to do to get late binding to work:

1) Remove the references
2) Replace the declarations from something like Dim objOutlook As
Outlook.Application to Dim objOutlook As Object
3) Change the instantiations from something like Set objOutlook = New
Outlook.Application to Set objOutlook = CreateObject("Outlook.Application")
4) Replace all of the references to intrinsic constants to the value of the
constant (or else declare the constants yourself)
 
Back
Top