Writing an API for Removing an Addin

B

bharat

Hello Everybody

I've a small Probs.. In my Excel Application....i've an Addin which
i'm creating while installing it thru MSI and now when i want to
uninstall it i need to remove the addin from the addin manager list as
well as frm my registry
how do i do that thru my MSI.. Is there any API available out there
for the same
please help me in finding the same
if it doesnt please help me in writing the API


help needed


thanks

bharat
 
B

Bob Phillips

You need to remove it fro the registry. There are two places in the registry
where the details of an addin are held, these are the keys on my machine
with Excel 2000, later versions might be a higher version number
Unloaded addins, that is addins that are in the list but not installed
HKEY_CURRENT_USER\Software\Microsoft\Office\9.0\Excel\Add-in Manager

Loaded addins,
HKEY_CURRENT_USER\Software\Microsoft\Office\9.0\Excel\Options


If you have uninstalled the addin from code, you should just need to delete
the item in Add-in Manager, whereas if it is still loaded you need to find a
key OPENn where n is null,1,2,3,... for that addin, and delete it.

Note that Excel updates the registry for addins on close, so I don't think
that you can't uninstall an addin via code and think you will see in in
Add-in Manager, it will still be in Options.


--

HTH


RP
(remove nothere from the email address if mailing direct)
 
B

Bob Phillips

Forgot to mention, if you delete an item from Options, any later keys should
be shuffled up. For instance, if you have keys Open1, Open2, ..., Open8 and
you delete Open5, Open6, 7 & 8 need to be shuffled up to 5, 6 and 7.

--

HTH

RP
(remove nothere from the email address if mailing direct)
 
B

bharat

Hi Peter

I tried that but it dint work for me
It was throwing an error saying

" c:\Windows\system32\cmd.exe-removingaddin.exe
The NTVDM CPU has encountered an Illegal Operation
CS:0e14:01f0 OP:63 74 69 6f 6e Choose 'Close' to terminate the
Application"

Please help me in understanding wat it says exactly..????

All the i'd modified in the file given is that: i replaced the addin
name

do i need to make any more changes to enable it to work

waiting for a wik reply

thanks in advance
 
P

Peter T

I've no idea why it's failing for you, can you step through the code and
note the line where things go wrong.

Couple of thoughts, need to be very careful about unwrapping the code from
Google, particularly the long API lines. Note the code is VB6 (dll or exe),
if using in VBA change "App." to "Application." or whatever reference you
may have set to Excel.Application. Ensure Option Explicit and Debug/Compile.
When I did that I had to sort out an "End If".

"The NTVDM CPU ", are you using in NT, maybe one of the API's is not
available in that OS, I don't know, but if not calling a non available API
could crash the system, or indeed any typo in the API lines.

You say the only thing you changed is the addin name, but note references to
addin collection are by Title not name (unless a title does not exist),
however I don't think an error there would trigger a crash.

Regards,
Peter T
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top