/build/static/layout/Breadcrumb_cap_w.png

Excel Addin removal from all the users profiles

Is there way to handle Excel addins Uninstall. I want to remove the OPEN key for this particular excel addin from all the registry entries from all the user profiles registry. any easy way to handle it, i do not have the option to move the xla files to the XLSTART folder in office.

Thanks

0 Comments   [ + ] Show comments

Answers (17)

Posted by: dj_xest 17 years ago
5th Degree Black Belt
0
hi bheers,

What particular MS Office? 2000 or XP? There is a built-in executable for adding Add-ins in Office 2000 (ExcelAddin.exe and ExcelAddinDash.exe). For Office XP, I can give to you my script for handling it in install and uninstall... Just send me beers first.. (kidding!)[:D]
Posted by: bheers 17 years ago
Second Degree Blue Belt
0
hehhe,

Thanks DJ, I have to handle office xp and office 2003. I have a script that reads the registry into temporary file and searches for the particulat xll or xla file, i wanted to remove it from all users so that when another user logs into the machine and launches excel after the addin removal he does not get an error message .
Posted by: viv_bhatt1 17 years ago
Senior Purple Belt
0
On a similar topic. I want to run a repair for an application "XYZ" on first launch of MS Excel after installation of the application "XYZ".

"XYZ" installs excel add-ins and in user profile hence the addins are not installed to Excel if a different user logs onto the machine.

Any idea what's the best way of doing this?


Cheers,
Vivek
Posted by: slb 17 years ago
Purple Belt
0
Just as a weird thought,
why not running your script as an activesetup part as a post-removal script..

Does this makes sense??
Posted by: dj_xest 17 years ago
5th Degree Black Belt
0
Bheers,

The error will pop up if you don't remove the entry in the HKCU registry. Anyway, here is my script. Feel free to modify it and send me... feedbacks...[:D]

**************************************
'DJ Xest
'Description: Used to remove Excel Add-Ins automatically in Office XP and Office 2003. Limited up to 100 Add-Ins only.

On Error Resume Next

Dim SCA,SCA1,XLReg,XLReg1,a,b
Set FSO = CreateObject("Scripting.FileSystemObject")
Set WshShell = CreateObject("WScript.Shell")

SCA="""" & "{Path and name of .xla}" & """"
SCA1="""" & "{Path and name of .xla}" & """"
XLReg=WshShell.RegRead ("HKCU\Software\Microsoft\Office\10.0\Excel\Options\OPEN")
XLReg1=WshShell.RegRead ("HKCU\Software\Microsoft\Office\11.0\Excel\Options\OPEN")

comparevalue=strcomp(XLReg, SCA, 1)
comparevalue1=strcomp(XLReg1, SCA1, 1)

if comparevalue=0 Then
WshShell.Regdelete ("HKCU\Software\Microsoft\Office\10.0\Excel\Options\OPEN")
end if

if comparevalue1=0 Then
WshShell.Regdelete ("HKCU\Software\Microsoft\Office\11.0\Excel\Options\OPEN")
end if


For a = 1 to 99
XLReg=WshShell.RegRead ("HKCU\Software\Microsoft\Office\10.0\Excel\Options\OPEN" & a)
if XLReg=SCA then
WshShell.Regdelete ("HKCU\Software\Microsoft\Office\10.0\Excel\Options\OPEN" & a)
exit for
end if

Next

For b = 1 to 99
XLReg1=WshShell.RegRead ("HKCU\Software\Microsoft\Office\11.0\Excel\Options\OPEN" & b)
if XLReg1=SCA1 then
WshShell.Regdelete ("HKCU\Software\Microsoft\Office\11.0\Excel\Options\OPEN" & b)
exit for
end if

Next

Wscript.Quit
**********************************
Posted by: bheers 17 years ago
Second Degree Blue Belt
0
This script removes XL addin from current user, i want it remove from all the user profiles.

I have used a script from © Bill James and made some changes to it to search for the exact file name and output as a reg file, not many changes are made except to make it silent, credit goes to Bill James.

Needs some more modifications on how to remove it from all the profiles and to change then rearrange the OPEN key values
****************************************************************************************************************

****************************************************************************************************************
Option Explicit
Dim oWS : Set oWS = CreateObject("WScript.Shell")
Dim oFSO : Set oFSO = CreateObject("Scripting.FileSystemObject")

Dim sSearchFor
' Change here for the addin to get removed add the exact entry as in the registry
sSearchFor = "/R \" &chr(34) &"C:\\Program Files\\Microsoft Office\\OFFICE11\\Library\\Analysis\\ANALYS32.XLL\" &chr(34)
'sSearchFor = "/R \" &chr(34) &"C:\\Essbase\\bin\\essexcln.xll\" &chr(34)
'sSearchFor = chr(34) &"\" &chr(34) &"C:\\Essbase\\bin\\essxleqd.xla\" &chr(34)
'MsgBox (sSearchFor)
If sSearchFor = "" Then Cleanup()

Dim StartTime : StartTime = Timer

Dim sRegTmp, sOutTmp, eRegLine, iCnt, sRegKey, aRegFileLines

sRegTmp = oWS.Environment("Process")("Temp") & "\RegTmp.tmp "
sOutTmp = oWS.Environment("Process")("Temp") & "\sOutTmp" & _
Hour(Now) & Minute(Now) & Second(Now) & ".tmp "

oWS.Run "regedit /e /a " & sRegTmp, , True '/a enables export as Ansi for WinXP

With oFSO.OpenTextFile(sOutTmp, 8, True)
.WriteLine("Windows Registry Editor Version 5.00" & VbCrLf)

With oFSO.GetFile(sRegTmp)
aRegFileLines = Split(.OpenAsTextStream(1, 0).Read(.Size), vbcrlf)
End With

oFSO.DeleteFile(sRegTmp)

For Each eRegLine in aRegFileLines
If InStr(1, eRegLine, "[", 1) > 0 Then sRegKey = eRegLine
If InStr(1, eRegLine, sSearchFor, 1) > 0 Then
If sRegKey <> eRegLine Then
If InStr(sRegKey,"11.0") then
.WriteLine(VbCrLf &"[HKEY_CURRENT_USER\Software\Microsoft\Office\11.0\Excel\Options]") & vbcrlf & "-" &eRegLine
Else
.WriteLine(VbCrLf &"[HKEY_CURRENT_USER\Software\Microsoft\Office\10.0\Excel\Options]") & vbcrlf & "-" &eRegLine
End If
Else
.WriteLine(vbcrlf & sRegKey)
End If
iCnt = iCnt + 1
End If
Next

Erase aRegFileLines

If iCnt < 1 Then
.Close
oFSO.DeleteFile(sOutTmp)
Cleanup()
End If
.Close

End With
if oFSO.FileExists ("C:\TEMP\HKCU_ExcelAddin.reg") Then
oFSO.DeleteFile("C:\TEMP\HKCU_ExcelAddin.reg")
else
oFSO.CreateTextFile("C:\TEMP\HKCU_ExcelAddin.reg")
oFSO.CopyFile sOutTmp, "C:\TEMP\HKCU_ExcelAddin.reg"
oFSO.DeleteFile(sOutTmp)
End if

'Dim oApp
' Set oApp = CreateObject("Excel.Application")
' oApp.Application.Visible = True
' oApp.AddIns("Analysis ToolPak").Installed = False
' oApp.Application.Quit
' set oApp = Nothing

Cleanup()

Sub Cleanup()
Set oWS = Nothing
Set oFSO = Nothing
WScript.Quit
End Sub
Posted by: dj_xest 17 years ago
5th Degree Black Belt
0
Hi Bheers,

Do you think you can put your script that will launch on startup for all users? Let's say put it in registry
(i.e. HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run) or startup folder so that when other users login excel-addin will be removed for them? What do you think? BTW, I can't make your script works on my end. Can you check?
Posted by: slb 17 years ago
Purple Belt
0
Hi Bheers,
As far as my understanding goes...
The only way to remove the addin keys from all users whoever logs in to the machine is either by

Using a runkey to run your vbscript as DJ suggested (or)
Use an activesetup routine (which should be implemented) on removal of the application.

The only difference being Runkey being run for each login of any user where as activesetup being run once per user login.

Hope this makes sense guys..
And correct me if i had been wrong.. [:D]
Posted by: dj_xest 17 years ago
5th Degree Black Belt
0
Yes slb, you are absolutely correct with the active setup trick to remove that excell addin in the registry.

Additionally, viv_bhatt1 can also use this active setup to force a repair on his xyz package for his excel-addin.[;)]
Posted by: slb 17 years ago
Purple Belt
0
Thanks for your comment DJ [:D]
hope it works for Bheers also [8D]
Posted by: bheers 17 years ago
Second Degree Blue Belt
0
I wil try the activesetup,

what the script does it, it searches the entire registry for the excel addin name as is in the registry and converts it into a regkey with a '-' appended to the regvalue,

we have a inhouse tool that uses this registry key and removes it from alll the user registry profile under HKEY_USERS.

DJ check the temp directory for the reg file, and make sure the Value you are searching is exactly the same as in the registry .
Posted by: bheers 17 years ago
Second Degree Blue Belt
0
I think removing the regkey will not be a problem but rearranging the OPEN key values will be, if there are 3 keys OPEN OPEN1 OPEN2

and if we remove OPEN then addins in OPEN1 and OPEN2 will not work i guess, i will recheck it again
Posted by: slb 17 years ago
Purple Belt
0
As far as I remember this will work.. when a new addin is being added then the new one will be in the OPEN key or whatever key that is missing in the order..
Did it work?? [:)]
Posted by: anonymous_9363 17 years ago
Red Belt
0
According to the documentation I have, you need to get a reference to the AddIns object and set the Installed property to False:

objXL.AddIns.Item("addin_name").Installed = False
Posted by: Robo Scripter 17 years ago
Orange Senior Belt
0
Here is the code for adding an add-in;


On Error Resume Next
Dim oXL : Set oXL = CreateObject("Excel.Application")
Dim oAddin : Set oAddin = oXL.AddIns.Add(session.property("INSTALLDIR") & "ist.xla", True)
oXL.Workbooks.Add
oAddin.Installed = True
oXL.Quit
Set oAddin = Nothing
Set oXL = Nothing

‘*************************************************************************
'Under Install Execute Sequence
'Location: AFTER InstallFinalize
'Condition: NOT REMOVE
'Properties: Immediate Execution; Synchronous; Always Execute


Here is the code for removing and add-in;


On Error Resume Next
Dim oXL : Set oXL = CreateObject("Excel.Application")
Dim oAddin : Set oAddin = oXL.AddIns.Add(session.property("INSTALLDIR") & "ist.xla", False)
oXL.Workbooks.Add
oAddin.Installed = False
oXL.Quit
Set oAddin = Nothing
Set oXL = Nothing

‘******************************************************************
'Under Install Execute Sequence
'Location : AFTER InstallInitialize
'Condition: REMOVE
'Properties: Immediate Execution; Synchronous; Always Execute

‘*************************************************************************
The above code may be altered to either run as an embedded vbscript from within a msi or in the case of multi user or Admin –vs- User installations the scripts can be best triggered via Microsoft Active Setup.
Posted by: vbc 17 years ago
Yellow Belt
0
Hi,

Last week, I did some work in the registry to try and have my Excel Add-In automatically added to every user on our Terminal Server box when they log on.

I went under the following registry address and added a new string value OPENx to reference the path of my .xla file:
HKEY_CURRENT_USER\Software\Mcirosoft\Office\xx.x\Excel\Options

I'm not sure if I also did something simliar under the HKEY_LOCAL_MACHINE path to add a simliar string value, but now every user that logs on to that Terminal Server and opens their Excel program, the add-in is automatically there.

Further, I deleted the string values. The Admin user's version of Excel had its add-in removed, but strangely, all other users can still access the add-in when logged in under that Terminal Server. This is baffling me.

As well, I tried to implement the same steps on our second Terminal Server box, but this time it's not working.

I tried to add the OPENx string value in each of the following registry paths but nothing happened:
HKEY_CURRENT_USER
HKEY_LOCAL_MACHINE
HKEY_USERS

I guess I'm trying to find an answer to how it worked on our first Terminal Server. The ideal solution was to add the add-in via the registry so that users don't have to add it themselves. Miraculously it worked last week, but this week as I tried to do the same thing on our second box, it didn't work.

Anyone know how properly add an add-in in the registry so that it's automatically installed on every users' Excel program? As well, to remove the add-in so that it becomes unavailable?

It's strange that after I removed the string values that are referencing the .xla file, all users are still able to access the add-in.

If anyone can offer guidance on this matter, I would really appreciate it.

Regards.
Posted by: topsophans 8 years ago
White Belt
0

This avoid to scrap other Addin excel (Work for all users) (Can be used in a custom action - Installshield)

On Error Resume Next
Dim WshShell
Set WshShell = WScript.CreateObject("Wscript.Shell")

Dim Addin, Open
Dim Count : Count = 0
Dim Found : Found = 0

Addin = """C:\Program Files\ComanyName\SoftwareName\Sofware.xlam"""

Open = WshShell.RegRead("HKCU\Software\Microsoft\Office\"OfficeVersion"\Excel\options\OPEN")

If IsEmpty(Open) Then
 WshShell.RegWrite "HKCU\Software\Microsoft\Office\"OfficeVersion"\Excel\options\OPEN", Addin
Else
 Do While Not IsEmpty(Open)
  If UCase(Open) = UCase(Addin) Then
   Found = 1
   Exit Do
  End If
  Count = Count + 1
  Open = Empty
  Open = WshShell.RegRead("HKCU\Software\Microsoft\Office\"OfficeVersion"\Excel\options\OPEN" & CStr(Count))
 Loop
 If Found = 0 Then WshShell.RegWrite "HKCU\Software\Microsoft\Office\"OfficeVersion"\Excel\options\OPEN" & CStr(Count), Addin
End If

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