PC Review


Reply
Thread Tools Rate Thread

change path to an add-in

 
 
Brian Murphy
Guest
Posts: n/a
 
      1st Oct 2008
If an xla add-in has been installed from folder A to the add-ins
collection, and I want to redirect it to another folder B, can this be
done from VBA?

Thanks,

Brian Murphy
 
Reply With Quote
 
 
 
 
Barb Reinhardt
Guest
Posts: n/a
 
      1st Oct 2008
It's not clear what you want to do? Move the add-in to Folder B or open a
file in Folder B? Or something else?

Barb Reinhardt

"Brian Murphy" wrote:

> If an xla add-in has been installed from folder A to the add-ins
> collection, and I want to redirect it to another folder B, can this be
> done from VBA?
>
> Thanks,
>
> Brian Murphy
>

 
Reply With Quote
 
Jon Peltier
Guest
Posts: n/a
 
      1st Oct 2008
Brian -

You need to uninstall the add-in, then add and install the add-in from the
new location:

AddIns("My Add-In").Installed = False
Set myAddIn = AddIns.Add(Filename:="C:\New Path\MYADDIN.XLA")

AddIns("My Add-In").Installed = True

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Tutorials and Custom Solutions
Peltier Technical Services, Inc. - http://PeltierTech.com
_______


"Brian Murphy" <(E-Mail Removed)> wrote in message
news:bce2534e-b4df-496e-9acb-(E-Mail Removed)...
> If an xla add-in has been installed from folder A to the add-ins
> collection, and I want to redirect it to another folder B, can this be
> done from VBA?
>
> Thanks,
>
> Brian Murphy



 
Reply With Quote
 
Peter T
Guest
Posts: n/a
 
      1st Oct 2008
It might not be not straightforward. If the addin originally was not in one
of the default library paths it'll be difficult to remove it from the addins
collection, after say uninstalling it and moving it (Name..As) to a
different folder. You'd be able to "apparently" add it back to the addins
collection but probably won't "install". No problems though if you rename
the addin after moving it, and ideally its title after first reloading as a
workbook. Might need to do it all in two sessions, first uninstall and move,
second session re-install

A better approach would be to amend the path in the OPENx key in the
registry (which can be done programmatically) along similar lines to an
installer.

Another thing you may need to do is update links in any wb that has the
addin's udf's in formulas.

It's a bit vague though as to what you are trying to do, what have you
attempted to do.

Regards,
Peter T


"Brian Murphy" <(E-Mail Removed)> wrote in message
news:bce2534e-b4df-496e-9acb-(E-Mail Removed)...
> If an xla add-in has been installed from folder A to the add-ins
> collection, and I want to redirect it to another folder B, can this be
> done from VBA?
>
> Thanks,
>
> Brian Murphy




 
Reply With Quote
 
Brian Murphy
Guest
Posts: n/a
 
      1st Oct 2008
The addin contains the following in its Auto_Open

Application.AddIns.Add ThisWorkbook.FullName

This puts the addin in the list in the Add-Ins dialog box, with the
check box empty.
If I close and reopen excel, it's still in the list. This is what I
want as it "installs" the addin for me.

If the addin is then opened manually from another folder, that .Add
statement above gets run and this seems to redirect the addin as being
installed from the second folder, but closing and reopening excel
shows that it's still "installed" from the first folder. This is not
what I want.

What is the right and proper way to "install" and "uninstall" an
addin. In this case I don't have to worry about links to UDF's in the
addin because this addin isn't used for that sort of thing. Can
registry settings be easily changed for any excel version?

Could a small VB6 program be used to launch one or more instances of
Excel to do the uninstalling and installing?

Thanks,

Brian
 
Reply With Quote
 
Peter T
Guest
Posts: n/a
 
      2nd Oct 2008
What you describe relates to the problem there is no direct way in VBA to
"Remove" an addin from the collection, and what I was trying to explain
previously. When you reinstall it from a new folder, the collection will
continue to "think" it is still in the old location. Also it will probably
not install by doing ad.Installed = True (after loading and re-adding to the
collection from it's new location).

Manually the way fully uninstall from the collection is to uncheck it,
remove it from file, attempt to re-check it, then accept the prompt to have
it removed from the list. I vaguely recall someone suggesting SendKeys to do
that but I've never tried.

With code, the only way to fully "remove" from the collection is by writing
to the registry (unless the addin is in a default library folder which makes
things easier). Indeed this can be done with a VB6 app, KeepItCool posted
full code in this ng to do just that (Excel must be closed). If you don't
want to go that route, try doing it along the lines I suggested - in two
sessions. Should work but will end up with the old defunct entry in the
non-installed list of addins in the registry (harmless clutter).

Note with addins "(un)Install" has two distinct meanings, install into the
addins collection and install such that it will auto-load at start-up.
Further, an addin can be installed in both senses yet not necessarily
loaded.

Regards,
Peter T


"Brian Murphy" <(E-Mail Removed)> wrote in message
news:68b4d7db-2976-419b-9bd9-(E-Mail Removed)...
> The addin contains the following in its Auto_Open
>
> Application.AddIns.Add ThisWorkbook.FullName
>
> This puts the addin in the list in the Add-Ins dialog box, with the
> check box empty.
> If I close and reopen excel, it's still in the list. This is what I
> want as it "installs" the addin for me.
>
> If the addin is then opened manually from another folder, that .Add
> statement above gets run and this seems to redirect the addin as being
> installed from the second folder, but closing and reopening excel
> shows that it's still "installed" from the first folder. This is not
> what I want.
>
> What is the right and proper way to "install" and "uninstall" an
> addin. In this case I don't have to worry about links to UDF's in the
> addin because this addin isn't used for that sort of thing. Can
> registry settings be easily changed for any excel version?
>
> Could a small VB6 program be used to launch one or more instances of
> Excel to do the uninstalling and installing?
>
> Thanks,
>
> Brian



 
Reply With Quote
 
Brian Murphy
Guest
Posts: n/a
 
      2nd Oct 2008
I have created a VB6 program using KeepItCool's posted code.
I call the VB6 program from my NSIS installer.
In my limited testing so far it works great!

Thanks for the great tip, Peter.
I've wanted to do this addin install/uninstall stuff for years, and
now I can

If I knew how to put a link to the specific post with the code, I
would.
Here is the header for the post.
Newsgroups: microsoft.public.excel.programming
From: keepITcool <xrrcvgp...@puryyb.ay>
Date: Sat, 16 Oct 2004 04:58:50 -0700
Local: Sat, Oct 16 2004 6:58 am
Subject: Re: remove add-in entry via registry

Cheers,

Brian
 
Reply With Quote
 
Jon Peltier
Guest
Posts: n/a
 
      2nd Oct 2008
The link is:

http://groups.google.com/group/micro...c6020456329d67

I've been using a variation of this for years which does the OPENx entries
in the Options key, but neglecting the entries in the Add-In Manager key. I
guess I need to make a few adjustments.

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Tutorials and Custom Solutions
Peltier Technical Services, Inc. - http://PeltierTech.com
_______


"Brian Murphy" <(E-Mail Removed)> wrote in message
news:2e15c3d7-48b8-4265-a945-(E-Mail Removed)...
>I have created a VB6 program using KeepItCool's posted code.
> I call the VB6 program from my NSIS installer.
> In my limited testing so far it works great!
>
> Thanks for the great tip, Peter.
> I've wanted to do this addin install/uninstall stuff for years, and
> now I can
>
> If I knew how to put a link to the specific post with the code, I
> would.
> Here is the header for the post.
> Newsgroups: microsoft.public.excel.programming
> From: keepITcool <xrrcvgp...@puryyb.ay>
> Date: Sat, 16 Oct 2004 04:58:50 -0700
> Local: Sat, Oct 16 2004 6:58 am
> Subject: Re: remove add-in entry via registry
>
> Cheers,
>
> Brian



 
Reply With Quote
 
Peter T
Guest
Posts: n/a
 
      2nd Oct 2008
Glad you got it working.

I've never used the NSIS installer although I've had it on my system for
years. A quick look in help suggests all can be done in the NSIS script
without the need for the separate VB6 app.

Regards,
Peter T



"Brian Murphy" <(E-Mail Removed)> wrote in message
news:2e15c3d7-48b8-4265-a945-(E-Mail Removed)...
>I have created a VB6 program using KeepItCool's posted code.
> I call the VB6 program from my NSIS installer.
> In my limited testing so far it works great!
>
> Thanks for the great tip, Peter.
> I've wanted to do this addin install/uninstall stuff for years, and
> now I can
>
> If I knew how to put a link to the specific post with the code, I
> would.
> Here is the header for the post.
> Newsgroups: microsoft.public.excel.programming
> From: keepITcool <xrrcvgp...@puryyb.ay>
> Date: Sat, 16 Oct 2004 04:58:50 -0700
> Local: Sat, Oct 16 2004 6:58 am
> Subject: Re: remove add-in entry via registry
>
> Cheers,
>
> Brian



 
Reply With Quote
 
Brian Murphy
Guest
Posts: n/a
 
      2nd Oct 2008
Jon,

That's the one. How does one go about getting a direct url to a
specific post?

I think I got it.
Click on 'More options" on the right.
Right click on "Individual message" and go "copy link location"

Is this how you did it?

Brian
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
change the cache mode path (.ost file path) =?Utf-8?B?YmxuLWFtaQ==?= Microsoft Outlook Installation 0 18th Jul 2006 08:45 AM
object follow path, change aspect along path =?Utf-8?B?YWxleGhtbXRz?= Microsoft Powerpoint 1 23rd Nov 2005 07:05 PM
how can we change absolute path to relative path waseem hijazi via .NET 247 Microsoft ADO .NET 0 15th May 2005 01:38 PM
set path, change path - path grayed out John Smith Windows XP Help 1 12th Feb 2005 01:56 PM
set path, change path - path grayed out John Smith Windows XP General 1 12th Feb 2005 01:56 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:42 AM.