PDA

View Full Version : Solved: The Full List of GUID References



Erdin? E. Ka
11-21-2006, 07:23 AM
I want to automatic install Microsoft ActiveX Data Objects 2.7 Library when workbook is open.

For example i can install Microsoft Windows Common Controls-2 6.0 (SP4) with this code:


Private Sub Workbook_Open()
On Error Resume Next
ThisWorkbook.VBProject.References.AddFromGuid _
"{86CF1D34-0C5F-11D2-A9FC-0000F8754DA1}", 2, 0
End Sub



But i want to have whole GUID References of all ActiveX objects.

Is it possible? Or any ideas?

Thanks in advance.:friends:

Erdin? E. Ka
11-21-2006, 08:05 AM
Hi everyone.

I solved myself. Thanks a lot.


Private Sub Workbook_Open()
' Microsoft ActiveX Data Objects 2.7 Library Eklemek i?in
On Error Resume Next
ThisWorkbook.VBProject.References.AddFromGuid _
"{EF53050B-882E-4776-B643-EDA472E8E3F2}", 2, 0
End Sub

Private Sub Workbook_BeforeClose(Cancel As Boolean)
' Microsoft ActiveX Data Objects 2.7 Library'yi kaldırmak i?in
Dim Nesne As Object
Adet = Application.VBE.ActiveVBProject.References.Count
Do While Application.VBE.ActiveVBProject.References.Count > 0 And Adet > 0
On Error Resume Next
Set Nesne = Application.VBE.ActiveVBProject.References.Item(Adet)
Aciklama = Nesne.Description
If Aciklama = "Microsoft ActiveX Data Objects 2.7 Library" Then
Application.VBE.ActiveVBProject.References.Remove Nesne
End If
Adet = Adet - 1
Loop
End Sub

Ken Puls
11-21-2006, 09:56 AM
Hi Erdinc,

Maybe a little late, but there is a KB entry on this as well: Determine the File Path or GUID to a VBA Reference Library

Actually, if you look up GUID in the KB, you'll find a few. :)

Erdin? E. Ka
11-21-2006, 10:14 AM
Hi Ken, Thank you very much. RefID is great. I saved to my archive. I will use that file for listing to GUIDs.

Thanks again.