Library not registered Error Message

N

Noemi

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
ExitHere:
Set rVBReference = Nothing
Exit Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top