Multiple Excel addins
I have an application with an Excel addin. When I capture turning on the addin from within Excel under Tools, Add-ins. I found this added a registry entry called OPEN under HKCU\Software\Microsoft\Office\10.0\Excel\Options.
Here is my problem; should another package be already installed with an Excel addin also I presume it is quite posssible for this package to have a value as OPEN already in which case my new package would over-write this addin.
Manual installations increment this OPEN value, to OPEN1,2,3 and so on - how do I do this with Wise?
Here is my problem; should another package be already installed with an Excel addin also I presume it is quite posssible for this package to have a value as OPEN already in which case my new package would over-write this addin.
Manual installations increment this OPEN value, to OPEN1,2,3 and so on - how do I do this with Wise?
0 Comments
[ + ] Show comments
Answers (30)
Please log in to answer
Posted by:
brenthunter2005
19 years ago
[8D]
Hello Naffcat (hehe, funny....)
Anyway, the way I have overcome this issue is to create two Custom Actions (install & uninstall). Remember to put the correct conditional statements on the CA's (ie: Install:NOT Installed / Uninstall: REMOVE~="ALL")
The VBScript CA's are as follows:
Install Custom Action:
On Error Resume Next
Set objShell = CreateObject("WScript.Shell")
strPlugin = """C:\Program Files\Application\ExcelAddin.xla""" 'This is the name of your Excel Addin
strExcelRegistryKey = "HKCU\Software\Microsoft\Office\11.0\Excel\Options" 'Becareful of your Office version here!
intCount = 0
intCompleted = 0
If objShell.RegRead(strExcelRegistryKey & "\Open") = "" Then
objShell.RegWrite strExcelRegistryKey & "\Open", strPlugin, "REG_SZ"
intCompleted = 1
End If
If intCompleted <> 1 Then
Err.Clear
Do Until Err.number = -2147024894
intCount = intCount + 1
strRegKey = strExcelRegistryKey & "\Open" & intCount
strRegKeyValue = objShell.RegRead(strRegKey)
Loop
objShell.RegWrite strExcelRegistryKey & "\Open" & intCount, strPlugin, "REG_SZ"
End If
Set objShell = Nothing
And this is the uninstall Custom Action:
On Error Resume Next
Set objShell = CreateObject("WScript.Shell")
strPlugin = "ExcelAddin.xla" 'Excel Plugin File Name only
strExcelRegistryKey = "HKCU\Software\Microsoft\Office\11.0\Excel\Options" 'Excel Registry Location (Dependable on Office version)
strRegKeyValue = objShell.RegRead(strExcelRegistryKey & "\Open")
If strRegKeyValue <> "" Then
If InStr(strRegKeyValue,strPlugin) Then
objShell.RegDelete strExcelRegistryKey & "\Open"
End If
End If
strRegKey = ""
strRegKeyValue = ""
intCount = 0
Err.Clear
Do Until Err.number = -2147024894
intCount = intCount + 1
strRegKey = strExcelRegistryKey & "\Open" & intCount
strRegKeyValue = objShell.RegRead(strRegKey)
If InStr(strRegKeyValue,strPlugin) Then
objShell.RegDelete strExcelRegistryKey & "\Open" & intCount
End If
Loop
Set objShell = Nothing
[8D] Keep cool. [8D]
Hello Naffcat (hehe, funny....)
Anyway, the way I have overcome this issue is to create two Custom Actions (install & uninstall). Remember to put the correct conditional statements on the CA's (ie: Install:NOT Installed / Uninstall: REMOVE~="ALL")
The VBScript CA's are as follows:
Install Custom Action:
On Error Resume Next
Set objShell = CreateObject("WScript.Shell")
strPlugin = """C:\Program Files\Application\ExcelAddin.xla""" 'This is the name of your Excel Addin
strExcelRegistryKey = "HKCU\Software\Microsoft\Office\11.0\Excel\Options" 'Becareful of your Office version here!
intCount = 0
intCompleted = 0
If objShell.RegRead(strExcelRegistryKey & "\Open") = "" Then
objShell.RegWrite strExcelRegistryKey & "\Open", strPlugin, "REG_SZ"
intCompleted = 1
End If
If intCompleted <> 1 Then
Err.Clear
Do Until Err.number = -2147024894
intCount = intCount + 1
strRegKey = strExcelRegistryKey & "\Open" & intCount
strRegKeyValue = objShell.RegRead(strRegKey)
Loop
objShell.RegWrite strExcelRegistryKey & "\Open" & intCount, strPlugin, "REG_SZ"
End If
Set objShell = Nothing
And this is the uninstall Custom Action:
On Error Resume Next
Set objShell = CreateObject("WScript.Shell")
strPlugin = "ExcelAddin.xla" 'Excel Plugin File Name only
strExcelRegistryKey = "HKCU\Software\Microsoft\Office\11.0\Excel\Options" 'Excel Registry Location (Dependable on Office version)
strRegKeyValue = objShell.RegRead(strExcelRegistryKey & "\Open")
If strRegKeyValue <> "" Then
If InStr(strRegKeyValue,strPlugin) Then
objShell.RegDelete strExcelRegistryKey & "\Open"
End If
End If
strRegKey = ""
strRegKeyValue = ""
intCount = 0
Err.Clear
Do Until Err.number = -2147024894
intCount = intCount + 1
strRegKey = strExcelRegistryKey & "\Open" & intCount
strRegKeyValue = objShell.RegRead(strRegKey)
If InStr(strRegKeyValue,strPlugin) Then
objShell.RegDelete strExcelRegistryKey & "\Open" & intCount
End If
Loop
Set objShell = Nothing
[8D] Keep cool. [8D]
Posted by:
Naffcat
19 years ago
Posted by:
brenthunter2005
19 years ago
Posted by:
Naffcat
19 years ago
Posted by:
Naffcat
19 years ago
I have found after playing around with the capture settings and capturing manually ticking on and off the addin I have now discovered some keys which jargon values which are getting removed when I untick the addin.
'HKEY_CURRENT_USER\Software\Microsoft\Office\10.0\EXCEL\resiliency\Startupitems
I think these may be causing the problem?
'HKEY_CURRENT_USER\Software\Microsoft\Office\10.0\EXCEL\resiliency\Startupitems
I think these may be causing the problem?
Posted by:
Naffcat
19 years ago
I now know how to remove the unwanted addins menu bar (the addin is correctly removed from the addins list under tools) ...
The steps are;
First close Excel
Run the VBscript to remove the addins OPEN value
Then delete the Excel10.xlb file from
C:\Documents and Settings\%username%\Application Data\Microsoft\Excel
The problem is I don't really understand the excel10.xlb and the consequences of deleting it. It appears that this file is created after closing Excel after ticking an addin on. I have found that if you then delete it with the addins left ticked on - this particular addin then re-creates the file but another addin didn't.
Have you come across this file before?
The steps are;
First close Excel
Run the VBscript to remove the addins OPEN value
Then delete the Excel10.xlb file from
C:\Documents and Settings\%username%\Application Data\Microsoft\Excel
The problem is I don't really understand the excel10.xlb and the consequences of deleting it. It appears that this file is created after closing Excel after ticking an addin on. I have found that if you then delete it with the addins left ticked on - this particular addin then re-creates the file but another addin didn't.
Have you come across this file before?
Posted by:
brenthunter2005
19 years ago
[8D]
Hello Naffcart,
This 'Excel10.xlb' file is known as the Excel Toolbar User Configuration file. It holds user customisations of the Excel toobar and window positions etc. Deleting this file will obviously delete any customisations.
I've never had these problems you have previously described.
Is Excel closed when install/uninstalling the MSI package?
Is the .xla file being removed successfully on uninstall?
Hello Naffcart,
This 'Excel10.xlb' file is known as the Excel Toolbar User Configuration file. It holds user customisations of the Excel toobar and window positions etc. Deleting this file will obviously delete any customisations.
I've never had these problems you have previously described.
Is Excel closed when install/uninstalling the MSI package?
Is the .xla file being removed successfully on uninstall?
Posted by:
PJO
19 years ago
Posted by:
brenthunter2005
19 years ago
Posted by:
Naffcat
19 years ago
Posted by:
brenthunter2005
19 years ago
Posted by:
brenthunter2005
19 years ago
Posted by:
WiseUser
19 years ago
. When I capture turning on the addin from within Excel under Tools, Add-ins. I found this added a registry entry called OPEN under HKCU\Software\Microsoft\Office\10.0\Excel\Options.
Here is my problem; should another package be already installed with an Excel addin also I presume it is quite posssible for this package to have a value as OPEN already in which case my new package would over-write this addin.
Here's another script for you, and anyone else who has this problem:
set oXL = CreateObject("Excel.Application")
oXL.Workbooks.Add
set oAddin = oXL.Addins.Add(sADDIN, True)
oAddin.Installed = True
Set oAddin = Nothing
oXL.Quit
Set oXL = Nothing
The best way to use this script, is to install it as a local VBS file (within your package) and create a shortcut to it in the "Startup" folder of the start menu.
Posted by:
brenthunter2005
19 years ago
Posted by:
PJO
19 years ago
Posted by:
brenthunter2005
19 years ago
[8D]
You can configure the ActiveSetup application name however you like in the registry.
The following registry keys:
are compared, and if the HKCU registry entries don't exist, or the version number of HKCU is less than HKLM, then the specified application is executed for the current user.
I write the HKLM ActiveSetup registry keys when the related MSI package is uninstalled. Therefore, the next time the user logs on, the ActiveSetup script will run and remove the specified Excel Add-in registry value.
[8D] Keep cool. [8D]
You can configure the ActiveSetup application name however you like in the registry.
The following registry keys:
HKLM\Software\Microsoft\Active Setup\Installed Components\WHATEVER_VALUE
and
HKCU\Software\Microsoft\Active Setup\Installed Components\WHATEVER_VALUE
are compared, and if the HKCU registry entries don't exist, or the version number of HKCU is less than HKLM, then the specified application is executed for the current user.
I write the HKLM ActiveSetup registry keys when the related MSI package is uninstalled. Therefore, the next time the user logs on, the ActiveSetup script will run and remove the specified Excel Add-in registry value.
[8D] Keep cool. [8D]
Posted by:
PJO
19 years ago
Posted by:
WiseUser
19 years ago
Posted by:
Paraleptropy
19 years ago
This looks good.
I have a question directly related to this procedure.
This scans through each Open string until it finds the first available one. What happens upon an uninstall? When the add-in is removed, how would you remove the Open Key that this was placed under?
The environment I'm working in is 2k / XP...
If this installs the addin as say, OPEN4 and other addin's get installed after that, and open 4 is removed, we will have to decrement the keys otherwise Excel will only open, OPEN / OPEN1 / OPEN2 / OPEN3. if OPEN4 is not present but OPEN5,6,7...etc are present, they will be ignored.
I need a way to install the add-in as well as remove it for All Users who log into the machine.
Any suggestions?
Thanks in advance.
I have a question directly related to this procedure.
This scans through each Open string until it finds the first available one. What happens upon an uninstall? When the add-in is removed, how would you remove the Open Key that this was placed under?
The environment I'm working in is 2k / XP...
If this installs the addin as say, OPEN4 and other addin's get installed after that, and open 4 is removed, we will have to decrement the keys otherwise Excel will only open, OPEN / OPEN1 / OPEN2 / OPEN3. if OPEN4 is not present but OPEN5,6,7...etc are present, they will be ignored.
I need a way to install the add-in as well as remove it for All Users who log into the machine.
Any suggestions?
Thanks in advance.
Posted by:
abeisty
18 years ago
The script below will remove the Excel Addin which you specifiy:
Dim oXL, oAddin
On Error Resume Next
Set oXL = CreateObject("Excel.Application")
oXL.Workbooks.Add
Set oAddin = oXL.AddIns.Add(session.property("INSTALLDIR") & "ist.xla", False)
oAddin.Installed = False
oXL.Quit
Set oXL = Nothing
Set OAddin = Nothing
'Under Install Execute Sequence
'Location : AFTER InstallInitialize
'Condition: REMOVE
'Properties: Immediate Execution; Synchronous; Always Execute
Dim oXL, oAddin
On Error Resume Next
Set oXL = CreateObject("Excel.Application")
oXL.Workbooks.Add
Set oAddin = oXL.AddIns.Add(session.property("INSTALLDIR") & "ist.xla", False)
oAddin.Installed = False
oXL.Quit
Set oXL = Nothing
Set OAddin = Nothing
'Under Install Execute Sequence
'Location : AFTER InstallInitialize
'Condition: REMOVE
'Properties: Immediate Execution; Synchronous; Always Execute
Posted by:
v101
15 years ago
Posted by:
anonymous_9363
15 years ago
Posted by:
v101
15 years ago
Posted by:
anonymous_9363
15 years ago
Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.
so that the conversation will remain readable.