Sub AddRuntimeLibrary()
Const imgFileName = "PrintIcon"
On Error Resume Next
Application.VBE.ActiveVBProject.References.AddFromFile "C:\Program Files\Common Files\Microsoft Shared\VBA\VBA6\VBE6.DLL"
Const GUIDRef = "{000204EF-0000-0000-C000-000000000046}"
Set PrntIcon = Application.CommandBars.FindControl(ID:=4)
On Error Resume Next 'Ignore Error If Reference Already Established
ThisWorkbook.VBProject.References.AddFromGuid GUIDRef, 4, 0
On Error Resume Next
Application.VBE.ActiveVBProject.References.AddFromFile "C:\Program Files\Microsoft Office\Office\EXCEL9.OLB"
Set PrntIcon = Application.CommandBars.FindControl(ID:=4)
On Error Resume Next 'Ignore Error If Reference Already Established
ThisWorkbook.VBProject.References.AddFromGuid GUIDRef, 1, 3
On Error Resume Next
Application.VBE.ActiveVBProject.References.AddFromFile "C:\WINDOWS\system32\stdole2.tlb"
Set PrntIcon = Application.CommandBars.FindControl(ID:=4)
On Error Resume Next 'Ignore Error If Reference Already Established
ThisWorkbook.VBProject.References.AddFromGuid GUIDRef, 2, 0
On Error Resume Next
Application.VBE.ActiveVBProject.References.AddFromFile "C:\Program Files\Microsoft Office\Office\MSO9.DLL"
Set PrntIcon = Application.CommandBars.FindControl(ID:=4)
On Error Resume Next 'Ignore Error If Reference Already Established
ThisWorkbook.VBProject.References.AddFromGuid GUIDRef, 2, 1
On Error Resume Next
Application.VBE.ActiveVBProject.References.AddFromFile "C:\WINDOWS\system32\FM20.DLL"
Set PrntIcon = Application.CommandBars.FindControl(ID:=4)
On Error Resume Next 'Ignore Error If Reference Already Established
ThisWorkbook.VBProject.References.AddFromGuid GUIDRef, 2, 0
On Error Resume Next
Application.VBE.ActiveVBProject.References.AddFromFile "C:\Program Files\Microsoft Office\Office\MSACC9.OLB"
Set PrntIcon = Application.CommandBars.FindControl(ID:=4)
On Error Resume Next 'Ignore Error If Reference Already Established
ThisWorkbook.VBProject.References.AddFromGuid GUIDRef, 9, 0
On Error Resume Next
Application.VBE.ActiveVBProject.References.AddFromFile "C:\Program Files\Common Files\Microsoft Shared\DAO\dao360.dll"
Set PrntIcon = Application.CommandBars.FindControl(ID:=4)
On Error Resume Next 'Ignore Error If Reference Already Established
ThisWorkbook.VBProject.References.AddFromGuid GUIDRef, 5, 0
On Error Resume Next
Application.VBE.ActiveVBProject.References.AddFromFile "C:\Program Files\Microsoft Office\Office12\MSWORD.OLB"
Set PrntIcon = Application.CommandBars.FindControl(ID:=4)
On Error Resume Next 'Ignore Error If Reference Already Established
ThisWorkbook.VBProject.References.AddFromGuid GUIDRef, 8, 4
On Error Resume Next
Application.VBE.ActiveVBProject.References.AddFromFile "C:\WINDOWS\system32\scrrun.dll"
Set PrntIcon = Application.CommandBars.FindControl(ID:=4)
On Error Resume Next 'Ignore Error If Reference Already Established
ThisWorkbook.VBProject.References.AddFromGuid GUIDRef, 1, 0
On Error Resume Next
Application.VBE.ActiveVBProject.References.AddFromFile "C:\Program Files\PDFCreator\PDFCreator.exe"
Set PrntIcon = Application.CommandBars.FindControl(ID:=4)
On Error Resume Next 'Ignore Error If Reference Already Established
ThisWorkbook.VBProject.References.AddFromGuid GUIDRef, 7, 1
End Sub