PC Review


Reply
Thread Tools Rate Thread

Add VB Reference

 
 
=?Utf-8?B?Q2hhZA==?=
Guest
Posts: n/a
 
      24th Aug 2007
I'm looking for code to add a reference to the Microsoft Outlook library. I
think its something like:

ThisWorkbook.VBProject.References.AddFromFile
or
ThisWorkbook.VBProject.References.AddFromGuid

but I can't figure out the final portion to actually add the reference. Or
perhaps there's a better way...

Any help is appreciated. Thanks,
Chad
 
Reply With Quote
 
 
 
 
=?Utf-8?B?VG9tIE9naWx2eQ==?=
Guest
Posts: n/a
 
      24th Aug 2007
Sub BBB()
'{00062FFF-0000-0000-C000-000000000046}
ThisWorkbook.VBProject.References.AddFromGuid _
"{00062FFF-0000-0000-C000-000000000046}", 5, 0

End Sub

You can always use late binding.


http://support.microsoft.com/?id=167223
Microsoft Office 97 Automation Help File Available on MSL

--
Regards,
Tom Ogilvy



"Chad" wrote:

> I'm looking for code to add a reference to the Microsoft Outlook library. I
> think its something like:
>
> ThisWorkbook.VBProject.References.AddFromFile
> or
> ThisWorkbook.VBProject.References.AddFromGuid
>
> but I can't figure out the final portion to actually add the reference. Or
> perhaps there's a better way...
>
> Any help is appreciated. Thanks,
> Chad

 
Reply With Quote
 
=?Utf-8?B?Q2hhZA==?=
Guest
Posts: n/a
 
      24th Aug 2007
when i run this i get the following run-time error: "Programmatic access to
Visual Basic Project is not trusted"

any thoughts? thanks.

"Tom Ogilvy" wrote:

> Sub BBB()
> '{00062FFF-0000-0000-C000-000000000046}
> ThisWorkbook.VBProject.References.AddFromGuid _
> "{00062FFF-0000-0000-C000-000000000046}", 5, 0
>
> End Sub
>
> You can always use late binding.
>
>
> http://support.microsoft.com/?id=167223
> Microsoft Office 97 Automation Help File Available on MSL
>
> --
> Regards,
> Tom Ogilvy
>
>
>
> "Chad" wrote:
>
> > I'm looking for code to add a reference to the Microsoft Outlook library. I
> > think its something like:
> >
> > ThisWorkbook.VBProject.References.AddFromFile
> > or
> > ThisWorkbook.VBProject.References.AddFromGuid
> >
> > but I can't figure out the final portion to actually add the reference. Or
> > perhaps there's a better way...
> >
> > Any help is appreciated. Thanks,
> > Chad

 
Reply With Quote
 
=?Utf-8?B?VG9tIE9naWx2eQ==?=
Guest
Posts: n/a
 
      24th Aug 2007
Tools=>Macro=>Security, Trusted Publishers Tab, click the appropriate
checkbox(s) in the lower left corner.

--
Regards,
Tom Ogilvy

"Chad" wrote:

> when i run this i get the following run-time error: "Programmatic access to
> Visual Basic Project is not trusted"
>
> any thoughts? thanks.
>
> "Tom Ogilvy" wrote:
>
> > Sub BBB()
> > '{00062FFF-0000-0000-C000-000000000046}
> > ThisWorkbook.VBProject.References.AddFromGuid _
> > "{00062FFF-0000-0000-C000-000000000046}", 5, 0
> >
> > End Sub
> >
> > You can always use late binding.
> >
> >
> > http://support.microsoft.com/?id=167223
> > Microsoft Office 97 Automation Help File Available on MSL
> >
> > --
> > Regards,
> > Tom Ogilvy
> >
> >
> >
> > "Chad" wrote:
> >
> > > I'm looking for code to add a reference to the Microsoft Outlook library. I
> > > think its something like:
> > >
> > > ThisWorkbook.VBProject.References.AddFromFile
> > > or
> > > ThisWorkbook.VBProject.References.AddFromGuid
> > >
> > > but I can't figure out the final portion to actually add the reference. Or
> > > perhaps there's a better way...
> > >
> > > Any help is appreciated. Thanks,
> > > Chad

 
Reply With Quote
 
=?Utf-8?B?Q2hhZA==?=
Guest
Posts: n/a
 
      24th Aug 2007
Perfect, thanks!

"Tom Ogilvy" wrote:

> Tools=>Macro=>Security, Trusted Publishers Tab, click the appropriate
> checkbox(s) in the lower left corner.
>
> --
> Regards,
> Tom Ogilvy
>
> "Chad" wrote:
>
> > when i run this i get the following run-time error: "Programmatic access to
> > Visual Basic Project is not trusted"
> >
> > any thoughts? thanks.
> >
> > "Tom Ogilvy" wrote:
> >
> > > Sub BBB()
> > > '{00062FFF-0000-0000-C000-000000000046}
> > > ThisWorkbook.VBProject.References.AddFromGuid _
> > > "{00062FFF-0000-0000-C000-000000000046}", 5, 0
> > >
> > > End Sub
> > >
> > > You can always use late binding.
> > >
> > >
> > > http://support.microsoft.com/?id=167223
> > > Microsoft Office 97 Automation Help File Available on MSL
> > >
> > > --
> > > Regards,
> > > Tom Ogilvy
> > >
> > >
> > >
> > > "Chad" wrote:
> > >
> > > > I'm looking for code to add a reference to the Microsoft Outlook library. I
> > > > think its something like:
> > > >
> > > > ThisWorkbook.VBProject.References.AddFromFile
> > > > or
> > > > ThisWorkbook.VBProject.References.AddFromGuid
> > > >
> > > > but I can't figure out the final portion to actually add the reference. Or
> > > > perhaps there's a better way...
> > > >
> > > > Any help is appreciated. Thanks,
> > > > Chad

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

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 On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
When I reference a cell in a separate list, I am unable to sort thatlist and keep the reference. Any suggested solutions? Mike C Microsoft Excel Discussion 2 15th Feb 2008 02:32 PM
Insert reference/cross-reference doesn't display my header text =?Utf-8?B?QmFiczI1?= Microsoft Word Document Management 3 24th Oct 2007 01:49 PM
ASP.NET 2.0: master pages and web user controls: reference to a non-shared member requires an object reference bminder Microsoft ASP .NET 0 24th Jun 2005 01:22 AM
Visual Basic .Net IDE Add-In that adds a Web Reference or Normal Reference to Current Project Bahige Microsoft VB .NET 0 1st Nov 2004 06:24 PM
Word 2002 cross reference problem: Error! Reference source not found Sam Dutton Microsoft Word Document Management 0 31st Mar 2004 02:49 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 12:43 AM.