ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Library not registered Error Message (https://www.excelbanter.com/excel-programming/401528-library-not-registered-error-message.html)

Noemi

Library not registered Error Message
 
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


All times are GMT +1. The time now is 01:28 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com