/build/static/layout/Breadcrumb_cap_w.png

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?

0 Comments   [ + ] Show comments

Answers (30)

Posted by: brenthunter2005 19 years ago
Fifth Degree Brown Belt
0
[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
Senior Purple Belt
0
Many thanks Brent,

Where would you advise these custom actions be put;

Execute Immediate or Deferred and at what point in the script?
Posted by: brenthunter2005 19 years ago
Fifth Degree Brown Belt
0
[8D]

Hello Naffcat,

Most CA's are usually put in the 'Normal Execute Immediate/Deffered' sequence.

Place the CA's one after another (Install, then Uninstall) anywhere in the sequence, but I would recommend after InstallFinalize.

[8D] Keep cool. [8D]
Posted by: Naffcat 19 years ago
Senior Purple Belt
0
Many thanks again Brent,

I have noticed a strange behaviour though, although I can see the registry entry correctly being added and removed when running the scripts. After adding and removing again the addin is still loaded even though the tick box under tools addins is unchecked? Any ideas?
Posted by: Naffcat 19 years ago
Senior Purple Belt
0
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?
Posted by: brenthunter2005 19 years ago
Fifth Degree Brown Belt
0
Sorry Naffcat,

I don't know those registry keys...

[&:]
Posted by: Naffcat 19 years ago
Senior Purple Belt
0
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?
Posted by: brenthunter2005 19 years ago
Fifth Degree Brown Belt
0
[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?
Posted by: PJO 19 years ago
Senior Yellow Belt
0
How do you guys normally deal with add-ins for different users? When you uninstall the application how do you uninstall the add-in for all the users who have logged into the machine.
Posted by: brenthunter2005 19 years ago
Fifth Degree Brown Belt
0
[8D]

Ahhhhhh, this is an issue.

But what I intend to force is that applications are installed AND uninstalled within the users context in a managed way, either by AD deployment, SMS, or a 3rd party software.

[8D] Keep cool. [8D]
Posted by: PJO 19 years ago
Senior Yellow Belt
0
It would be nice to have that option!!
Posted by: Naffcat 19 years ago
Senior Purple Belt
0
Brent,

Yes the problem was to do with Excel being open, everything works better when it is closed.

Haven't tried yet but am pretty sure removing the addin file with the script you kindly supplied will work.

(I was just using the script outside of an uninstall)

Many thanks again.
Posted by: brenthunter2005 19 years ago
Fifth Degree Brown Belt
0
[8D]

If you want to get smart [8|], you could have another script check the running processes and if Excel is open ask the user [:D] to close it down and then the MSI could continue.........

[8D]
Posted by: Naffcat 19 years ago
Senior Purple Belt
0
[8|] Yes, I've done one of these, I might just do that. Thanks.
Posted by: brenthunter2005 19 years ago
Fifth Degree Brown Belt
0
[8D]

You can use ActiveSetup to remove the Excel add-in for other users when they log into the computer next.

I tried this yesterday and works very well actually.

[8D] Nice one.... [8D]
Posted by: WiseUser 19 years ago
Fourth Degree Brown Belt
0
. 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:


Const sADDIN = "C:\Program Files\Microsoft Office\Office10\Library\Whatever.xla"

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
Fifth Degree Brown Belt
0
[8D]

Hello WiseUser,

Does this script add the Add-in globally or just for this specific workbook?

[8D]
Posted by: PJO 19 years ago
Senior Yellow Belt
0
I have used ActiveSetup to install the add-in for other users, but how do you do this to remove the add-in? Doesn't it work on the guid of the app being installed?
Posted by: brenthunter2005 19 years ago
Fifth Degree Brown Belt
0
[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
Senior Yellow Belt
0
Actually it ok! I got it,
http://bonemanblog.blogspot.com/2004/12/active-setup-registry-keys-and-their.html

Thanks

PJ
Posted by: brenthunter2005 19 years ago
Fifth Degree Brown Belt
0
Nice.
Posted by: PJO 19 years ago
Senior Yellow Belt
0
Thanks [8D]
Posted by: WiseUser 19 years ago
Fourth Degree Brown Belt
0
ORIGINAL: brenthunter2005

[8D]

Hello WiseUser,

Does this script add the Add-in globally or just for this specific workbook?

[8D]


Globally (I hope) - otherwise the script would be useless!
Posted by: Paraleptropy 19 years ago
Yellow Belt
0
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.
Posted by: Paraleptropy 19 years ago
Yellow Belt
0
Anyone? Someone has had to run into this before!
Posted by: abeisty 18 years ago
Senior Yellow Belt
0
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
Posted by: v101 15 years ago
Senior Yellow Belt
0
anyone know how to modify the excel.xlb to remove the addin automatically? the scripts runs fine to add/remove the addin, but the addin is still left in the excel excel.xlb file. i would like to clean the Excel Toolbar User Configuration as much as possible after removing the addin. any suggestion?
Posted by: anonymous_9363 15 years ago
Red Belt
0
Don't quote me but I *think* I'm right in saying that, if you delete this file, XL will rebuild it on start-up.
Posted by: v101 15 years ago
Senior Yellow Belt
0
even if that is the case, I dont want the users to lose their customization or new addin. i just want the addin that is been removed remove as an option in the tools bar.
Posted by: anonymous_9363 15 years ago
Red Belt
0
My mistake. Deleting this file will remove ALL user customisations.Sub-optimal...

IIRC, you can use the relevant application's Automation Model to add and remove items from Office applications. I seem to remember, many moons ago, doing one for an Outlook add-in.
Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.
 
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ