I am trying to create an MSI installer that installs an add-in (.xla) in Microsoft Excel (2007 in my case). Installation is going well. I use "Custom Action", which runs this VBScript file:
Dim SourceDir
Dim objExcel
Dim objAddin
SourceDir = Session.Property("CustomActionData")
Set objExcel = CreateObject("Excel.Application")
objExcel.Workbooks.Add
Set objAddin = objExcel.AddIns.Add(SourceDir & "addin.xla", True)
objAddin.Installed = True
objExcel.Quit
Set objExcel = Nothing
I pass the addin location to the script using the CustomActionData property. The add-in is copied to the folder inside the "Program Files", where it will remain until it is deleted. This is done by the installer.
The problem is that I am using an uninstall script:
Dim objExcel
Dim addin
On Error Resume Next
Set objExcel = CreateObject("Excel.Application")
For i = 0 To objExcel.Addins.Count
Set objAddin= objExcel.Addins.item(i)
If objAddin.Name = "addin.xla" Then
objAddin.Installed = False
End If
Next
objExcel.Quit
Set objExcel = Nothing
Addin creates a custom toolbar in Excel u [installation. The toolbar is not deleted when deleted, and the add-in entry in the "Add-in" section in Excel settings is also not.
- , VBScript?