Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Nesting a sheet name reference within a cell reference??? | Excel Discussion (Misc queries) | |||
Changing sheet reference to cell reference | Excel Worksheet Functions | |||
Using an offset formula for the reference in a relative reference | Excel Worksheet Functions | |||
Row reference increment but preserve column reference | Excel Worksheet Functions | |||
Macro to Reference Column Next to Current Reference | Excel Discussion (Misc queries) |