Hi
I am trying to set the library reference for outlook in excel as each person
has a different version of excel on their pc's but I get the following
message:
Automated error, Library not registered
Below is my code.
Dim rVBReference As VBIDE.Reference
Dim wbBook As Workbook
Dim stGuid As String
Set wbBook = ThisWorkbook
stGuid = Outlook.Application.COMAddIns(1).GUID
With wbBook
For Each rVBReference In .VBProject.References
If rVBReference.GUID = stGuid Then
GoTo ExitHere
End If
Next rVBReference 'Create the external reference in the
VB-project..
ThisWorkbook.VBProject.References.AddFromGuid stGuid, 8, 0
GoTo ExitHere
End With
ExitHe
Set rVBReference = Nothing
Exit Sub