There's no such thing as a stupid question, but they're the easiest to answer.
JoinTour
Login
 
Tag Cloud
access audio avg avg 8 bios blue screen boot bsod computer connection cpu crash css dell desktop dma driver drivers dvd email error excel explorer firefox firefox 3 freeze gimp graphics hard drive hardware hijackthis hjt install internet internet explorer itunes keyboard laptop macro malware monitor motherboard network networking outlook outlook 2003 outlook 2007 outlook express pio problem problems router seo server slow sound sp3 spyware trojan usb video virtumonde virus vista vundo windows windows vista windows xp winxp wireless
Software Development
Search
Search in:
 
Advanced Search
Tech Support Guy Forums > Software & Hardware > Software Development >
VB-- Need to programmatically update reference library


HELLO AND WELCOME! Before you can post your question, you'll have to register -- it's completely free! Click here to join today! We highly recommend that you print a copy of our Guide for New Members. Enjoy!

 
Thread Tools
johnnyy2k's Avatar
Junior Member with 2 posts.
 
Join Date: Nov 2005
Experience: Advanced
16-Dec-2005, 12:41 PM #1
VB-- Need to programmatically update reference library
I am using Office 2003 and use code that references the Outlook reference library. The problem I am having is Outlook 2003 uses 11.0 and many of the users use Outlook 2000 which uses 9.0. Whenever I work with the spreadsheet is automatically updates the library to 11.0 and then my users get an error when they try to use the code. Does anyone know a trick or code to automatically select the appropriate library when the project is opened?

Thanking you in advance!

cristobal03's Avatar
Distinguished Member with 2,991 posts.
 
Join Date: Aug 2005
Experience: Advanced
16-Dec-2005, 01:00 PM #2
I'm assuming you're using early binding? I think you'd probably just have to add the earlier object library to your references. But that seems like a bad idea because they'd probably conflict, in which case the one set at the higher priority takes precedence (I think).

I don't know hardly anything about late binding, so I can't help you there.

chris.
OBP's Avatar
OBP OBP is offline
Computer Specs
Distinguished Member with 6,370 posts.
 
Join Date: Mar 2005
Location: UK
Experience: An old Basic Programmer
16-Dec-2005, 03:36 PM #3
I quote this from an Excel VBA programming book :-
You can add a reference programmatically using either of two methods of the Reference "class". AddFromfile adds a reference if you know it's file name and storage path.
AdFromGuid adds a reference if you know the reference's globally unique identifier, or GUID. Refer to the online help for complete details
__________________
.
.
OBP
I do not give up easily
johnnyy2k's Avatar
Junior Member with 2 posts.
 
Join Date: Nov 2005
Experience: Advanced
08-Mar-2006, 02:32 PM #4
Smile Thanks
I've been trying to get it to work. I think the ADDFROMGUID is the best option. Thanks!
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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

You Are Using:
Server ID
Advertisements do not imply our endorsement of that product or service.
All times are GMT -4. The time now is 06:44 PM.
Copyright © 1996 - 2008 TechGuy, Inc. All rights reserved.
Powered by vBulletin, Copyright © 2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Powered by Cermak Technologies, Inc.