Install Excel Add-In
Option Explicit
On Error Resume Next
Dim ObjWshShell, ProgramFiles, AddInPath
Dim oXL, oAddin
Set ObjWshShell = CreateObject(“WScript.Shell”)
ProgramFiles = ObjWshShell.ExpandEnvironmentStrings(“%ProgramFiles%”)
AddInPath = ProgramFiles & “\MyAppFolder\MyAddIn.xla”
Set oXL = CreateObject(“Excel.Application”)
oXL.Workbooks.Add
Set oAddin = oXL.AddIns.Add(AddInPath, True)
oAddin.Installed = True
oXL.Quit
Set oXL = Nothing
Set oAddin = Nothing
Set ObjWshShell = Nothing
WScript.Quit
Uninstall Excel Add-In
Option Explicit
On Error Resume Next
Dim oXL,i
Dim crAddin
Set oXL = CreateObject(“Excel.Application”)
For i = 1 to oXL.Addins.Count
Set crAddin = oXL.Addins.item(i)
If crAddin.Name = “MyAddIn.xla” then
crAddin.Installed = False
End If
Next
oXL.Quit
Set oXL = Nothing
Set crAddin = Nothing
WScript.Quit