How to remove missing reference and add reference for different Excel versions

G

Guest

Greetings to all

When I have a outlook 10.0 object library as a reference and user only has outlook 9.0 in their machine. It has this missing outlook 10.0 object library. Is there a way to remove missing reference/library programatically in VBA? And How to detect what version of object library in their machine and automatically add it in? Thanks much

Wish you all have a wonderful day and weekend.
 
S

Stephen Bullen

Hi Luvgreen,
Greetings to all!

When I have a outlook 10.0 object library as a reference and user only has outlook 9.0 in their machine. It has this missing outlook
10.0 object library. Is there a way to remove missing reference/library programatically in VBA? And How to detect what version of object
library in their machine and automatically add it in? Thanks much!

Yes, but not if the project is protected (which it should be when deploying it to your users). The usual way of doing this is to use
late binding instead of early binding. In that situation, you remove the reference to the Outlook library entirely, dimension all the
'Outlook' objects 'As Object' instead of as a specific type and use CreateObject (instead of 'As New') to connect to Outlook.

Regards

Stephen Bullen
Microsoft MVP - Excel
www.BMSLtd.ie
 

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