Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 273
Default Add VB Reference

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
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default Add VB Reference

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

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 273
Default Add VB Reference

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

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default Add VB Reference

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

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 273
Default Add VB Reference

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
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
Nesting a sheet name reference within a cell reference??? Broyston Excel Discussion (Misc queries) 9 July 8th 08 08:35 PM
Changing sheet reference to cell reference TeeJay Excel Worksheet Functions 3 October 19th 07 11:50 AM
Using an offset formula for the reference in a relative reference Cuda Excel Worksheet Functions 6 November 15th 06 05:12 PM
Row reference increment but preserve column reference Pwanda Excel Worksheet Functions 1 April 28th 05 01:12 PM
Macro to Reference Column Next to Current Reference dolphinv4 Excel Discussion (Misc queries) 2 April 11th 05 08:36 AM


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