Microsoft Excel bünyesindeki eklentileri listelemeye yarayan VBA kodudur.
Option Explicit
Sub EklentileriListele1()
'--------------------------------------------------
'Değişkenler
'--------------------------------------------------
Dim i As Integer
Dim eklenti As Object
' Dim sayfa As Worksheet
'
' Sheets.Add.Move After:=Sheets(Sheets.Count)
' Sheets(Sheets.Count).Name = "Eklentiler"
'
' Set sayfa = Sheets("Eklentiler")
' sayfa.Activate
'--------------------------------------------------
'Tablo başlıklarını yazdır.
'--------------------------------------------------
Cells(1, 1).value = "Eklenti Adı"
Cells(1, 2).value = "Eklenti Yolu"
Cells(1, 3).value = "Eklenti Boyutu"
Cells(1, 4).value = "Eklentiyi Oluşturma Tarihi"
Cells(1, 5).value = "Dosya Tipi"
Cells(1, 6).value = "Aktiflik Durumu"
'--------------------------------------------------
'Değişkenlere değer ataması yap.
'--------------------------------------------------
Set eklenti = CreateObject("Scripting.FileSystemObject")
'--------------------------------------------------
'Eklentileri listele.
'--------------------------------------------------
For i = 1 To Application.AddIns.Count
Cells(i + 1, 1).value = Application.AddIns(i).Name
Cells(i + 1, 2).value = Application.AddIns(i).Path
Cells(i + 1, 3).value = Int(eklenti.GetFile(Application.AddIns(i).FullName).Size / 1024) & " KB"
Cells(i + 1, 4).value = eklenti.GetFile(Application.AddIns(i).FullName).DateCreated
Cells(i + 1, 5).value = eklenti.GetFile(Application.AddIns(i).FullName).Type
If Application.AddIns(i).Installed = False Then
Cells(i + 1, 6).value = "Aktif Değil"
Else
Cells(i + 1, 6).value = "Aktif"
End If
Next i
'--------------------------------------------------
'Sütunları otomatik olarak boyutlandır.
'--------------------------------------------------
Columns("A:F").EntireColumn.AutoFit
End Sub
Sub EklentileriListele2()
Dim satir As Integer
Dim eklenti As AddIn
satir = 1
For Each eklenti In Application.AddIns
Cells(satir, 1) = eklenti.Name
Cells(satir, 2) = eklenti.Installed
satir = satir + 1
Next
End Sub