Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 126
Default change path to an add-in

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
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,355
Default change path to an add-in

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

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,582
Default change path to an add-in

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" wrote in message
...
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



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,600
Default change path to an add-in

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" wrote in message
...
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




  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 126
Default change path to an add-in

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


  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,600
Default change path to an add-in

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" wrote in message
...
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



  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 126
Default change path to an add-in

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
Date: Sat, 16 Oct 2004 04:58:50 -0700
Local: Sat, Oct 16 2004 6:58 am
Subject: remove add-in entry via registry

Cheers,

Brian
  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,582
Default change path to an add-in

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" wrote in message
...
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
Date: Sat, 16 Oct 2004 04:58:50 -0700
Local: Sat, Oct 16 2004 6:58 am
Subject: remove add-in entry via registry

Cheers,

Brian



  #9   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,600
Default change path to an add-in

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" wrote in message
...
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
Date: Sat, 16 Oct 2004 04:58:50 -0700
Local: Sat, Oct 16 2004 6:58 am
Subject: remove add-in entry via registry

Cheers,

Brian



  #10   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 126
Default change path to an add-in

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


  #11   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 126
Default change path to an add-in


That's interesting. I didn't think about doing it within NSIS.

But if I had, I still would have done it with VB6 because I consider
that to be a much easier route. Especially since KeepItCool had
already written the VB6 code.

Brian



On Oct 2, 9:26 am, "Peter T" <peter_t@discussions wrote:
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" wrote in message

...

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
Date: Sat, 16 Oct 2004 04:58:50 -0700
Local: Sat, Oct 16 2004 6:58 am
Subject: remove add-in entry via registry


Cheers,


Brian


  #12   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,582
Default change path to an add-in

That's exactly right.

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


"Brian Murphy" wrote in message
...
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



  #13   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,582
Default change path to an add-in

I use Inno Setup for my installations, and usually just call my VB6 exe at
the end of installation. I know I can do the registry stuff from Inno, but
I'm not very good with the Pascal scripting.

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


"Brian Murphy" wrote in message
...

That's interesting. I didn't think about doing it within NSIS.

But if I had, I still would have done it with VB6 because I consider
that to be a much easier route. Especially since KeepItCool had
already written the VB6 code.

Brian



On Oct 2, 9:26 am, "Peter T" <peter_t@discussions wrote:
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" wrote in message

...

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
Date: Sat, 16 Oct 2004 04:58:50 -0700
Local: Sat, Oct 16 2004 6:58 am
Subject: remove add-in entry via registry


Cheers,


Brian




Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to change Name of Path Sadie Setting up and Configuration of Excel 0 March 21st 07 10:52 PM
Absolute Path change ... Sige Excel Discussion (Misc queries) 5 February 6th 06 03:10 PM
Change the path of a Microsoft Query? MWH Excel Programming 1 January 24th 06 02:54 AM
how to change absolute path to relative path hwijgerse Excel Worksheet Functions 0 November 25th 05 07:18 AM
change query path shin Excel Programming 0 June 17th 05 04:12 PM


All times are GMT +1. The time now is 02:56 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"