Список надстроек в библиотеке и памяти

Просмотреть список надстроек, хранящихся в папке библиотеки (LIBRARY) и в памяти:

Sub AddIns_List()  
Dim iFor%, iRow%, WS As Worksheet  
  
  iRow = 1  
  Set WS = ThisWorkbook.Worksheets("AddIns")  
  
'Видит только папку LIBRARY  
  If Application.AddIns.Count > 0 Then  
  WS.Cells(iRow, 1) = "Установлены следующие надстройки (AddIns):"  
  For iFor = 1 To Application.AddIns.Count  
  iRow = iRow + 1  
  WS.Cells(iRow, 1) = Application.AddIns.Item(iFor).FullName  
  Next iFor  
  End If  
  
' - Только для офиса 2010 и 2013  
#If VBA7 Then  
  If iRow > 1 Then iRow = iRow + 1  
'Видит только папку LIBRARY и то, что сейчас есть в памяти  
  If Application.AddIns2.Count > 0 Then  
  WS.Cells(iRow, 1) = "Установлены следующие надстройки (AddIns2):"  
  For iFor = 1 To Application.AddIns2.Count  
  iRow = iRow + 1  
  WS.Cells(iRow, 1) = Application.AddIns2.Item(iFor).FullName  
  Next iFor  
  End If  
  
  If iRow > 1 Then iRow = iRow + 1  
'Description, Guid, ProgId - String; Connect - Boolean  
  If Application.COMAddIns.Count > 0 Then  
  WS.Cells(iRow, 1) = "Установлены следующие надстройки (COMAddIns):"  
  For iFor = 1 To Application.COMAddIns.Count  
  iRow = iRow + 1  
  WS.Cells(iRow, 1) = Application.COMAddIns.Item(iFor).Description  
  Next iFor  
  End If  
#End If  
  
If Not WS Is Nothing Then Set WS = Nothing  
End Sub

Оставьте комментарий