Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default Add reference to Outlook library programmatically

Hi,
Can someone tell me how to programmatically add a reference to a
library (Outlook, in my case) ?

Thanks,
Hiran

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Add reference to Outlook library programmatically

Hi Hiran

Why not use Late binding

I use it here for example
http://www.rondebruin.nl/mail/folder2/mail2.htm

See the info about Early binding below the macro


--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"Hiran" wrote in message ...
Hi,
Can someone tell me how to programmatically add a reference to a
library (Outlook, in my case) ?

Thanks,
Hiran

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default Add reference to Outlook library programmatically

Try something like

Sub AddOutlookRef()
' reference current installed version of Outlook
On Error Resume Next 'ignore if already set
ThisWorkbook.VBProject.References.AddFromGuid _
GUID:="{00062FFF-0000-0000-C000-000000000046}", _
major:=0, Minor:=0
End Sub

You can add a reference to any file if you know the file name:

Sub AAA()
ThisWorkbook.VBProject.References.AddFromFile _
Filename:="C:\Path\FileName.ext"
End Sub

Cordially,
Chip Pearson
Microsoft Most Valuable Professional
Excel Product Group
Pearson Software Consulting, LLC
www.cpearson.com
(email on web site)



On Tue, 21 Oct 2008 09:49:47 -0700 (PDT), Hiran
wrote:

Hi,
Can someone tell me how to programmatically add a reference to a
library (Outlook, in my case) ?

Thanks,
Hiran

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default Add reference to Outlook library programmatically

Thanks Ron and Chip. You guys are priceless!
Hiran
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default Add reference to Outlook library programmatically

Chip,
I'm now trying to use this to add the ADO2.8 library (msado 15.dll)
and I get Run-time error '48' 'Error in loading DLL'.
What am I missing?
Thanks,
Hiran


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
Outlook 11.0 Library Bret Excel Programming 10 August 3rd 06 05:58 AM
Outlook 11 Outlook 10 Object Library Compatibility Issues Paul Mac[_4_] Excel Programming 11 May 19th 06 04:27 AM
Adding library references programmatically Alan Beban[_2_] Excel Programming 5 August 25th 05 05:21 PM
Reference Library - Missing Library in a lower version. luvgreen Excel Programming 1 October 7th 04 02:08 AM
programmatically Set Reference to Library Todd uttenstine Excel Programming 6 April 30th 04 10:55 AM


All times are GMT +1. The time now is 11:10 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"