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)