Results 1 to 11 of 11
  1. #1
    Gold Lounger
    Join Date
    Dec 2000
    Location
    New Hampshire, USA
    Posts
    3,386
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Adding Add-IN programmatically (2002)

    I'm trying to set up code to automate the installation on an Excel Add-In.
    As a test, I tried the following:

    1. Call the Add-In XYZ.
    2. Install the Add-In using a file in some local directory, say,
    D:FooXYZ.xla.
    No problem doing that.

    3. Now, run the install code, which:

    a. Sets the .Installed property for the file installed in D:Foo to vbFalse

    b. Then copies the master file, call it, MasterXYZ.xla to the
    Office10Library directory and installs the file as the XYZ Add-In.

    Exit Excel.

    I cannot (always) rename the D:FooXYZ.xla file. I'm trying this just
    to verify that the add-in is installed correctly.
    Sometimes I can, other times I cannot.
    Either I'm doing something wrong, or it's a case of a file handle not being
    released.
    There are no entries for the Add-In in the Registry.

    Am I messing up?
    Is there a workaround?

  2. #2
    Bronze Lounger
    Join Date
    Jun 2001
    Location
    New York, New York, Lebanon
    Posts
    1,449
    Thanks
    1
    Thanked 1 Time in 1 Post

    Re: Adding Add-IN programmatically (2002)

    <img src=/S/hello.gif border=0 alt=hello width=25 height=29> Howard

    Oh boy did you pick a hard area to work with. AFAIK Add-ins is an area that MS have left without any real easy ways for Users to manipulate.

    I know that for an Add-In there are two attributes that need to be checked:

    <font color=red> Installed
    Activated </font color=red>


    If the Add-In is installed that means it will show up in the list of Add-Ins. If the Add-In is activated, that means it has a Check in the list, and thus can be used. Having the Add-In installed does not automatically activate it in all cases.

    I am sure that you are checking that you are checking that XYZ.xla does exist in D:Foo. If not, I think you need to do that.
    Why are you copying the Add-In Master file? Is it the first time you are installing the Add-In?
    What is there is already an Add-In called XYZ.xla in the list of installed Add-Ins?

    What is unique during the times when you can rename the Add-In file? Is it the first time after a clean launch of MS-Excel? Or the first time you try the code?

    OK Hope these questions would jog your memory. Keep us informed of what you find.

    Wassim
    <img src=/S/compute.gif border=0 alt=compute width=40 height=20> in the <img src=/S/bagged.gif border=0 alt=bagged width=22 height=22>

  3. #3
    Uranium Lounger
    Join Date
    Jan 2001
    Location
    South Carolina, USA
    Posts
    7,295
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Adding Add-IN programmatically (2002)

    I spent a month trying to do that in XL97 about 3 years ago, and never did get it to work properly.
    Legare Coleman

  4. #4
    Gold Lounger
    Join Date
    Feb 2001
    Location
    Dublin, Ireland, Republic of
    Posts
    2,697
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Re: Adding Add-IN programmatically (2002)

    Why not copy the AddIn directly to Application.LibrayPath, renaming if required, and then install it.

    Andrew C

  5. #5
    Gold Lounger
    Join Date
    Dec 2000
    Location
    New Hampshire, USA
    Posts
    3,386
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Adding Add-IN programmatically (2002)

    The problem has gone away.
    I expect that there was a rouge file handle that had not yet been released.

    I don't recall whether the problem occurred before, or after, I installed Office XP SP2 (I installed SP 2 a few daze ago).
    Procedure is working now without a problem.

  6. #6
    Gold Lounger
    Join Date
    Dec 2000
    Location
    New Hampshire, USA
    Posts
    3,386
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Adding Add-IN programmatically (2002)

    Much of what I do is in a "hard area".
    If MSFT Would only properly document their stuff, alas, I can dream, n'est-ce pas?

    The next area I intend to attack is using the setup and packaging wizard.
    I've heard horror stories about those.
    Never had a need to (ab)use them before.

    I'll likely start after tonight's World Series game.
    You'll likely hear my cries of pain!

  7. #7
    Gold Lounger
    Join Date
    Dec 2000
    Location
    New Hampshire, USA
    Posts
    3,386
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Adding Add-IN programmatically (2002)

    I did not use Excel VBA much up until a few months ago.
    The handling of Add-Ins is enhanced in Excel 2002 over Excel 2000.
    Not sure how Excel 2000 changed over Excel 97 for handling Add-Ins.

  8. #8
    Gold Lounger
    Join Date
    Dec 2000
    Location
    New Hampshire, USA
    Posts
    3,386
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Adding Add-IN programmatically (2002)

    That's what I'm doing, but one first needs to uninstall earlier version.

    Doing things programmatically is harder than doing manually because, when doing something via th GUI, MSFT does things internally that we/I may not know about.

    I would guess that a file handle got stubborn about being released.

  9. #9
    Bronze Lounger
    Join Date
    Jun 2001
    Location
    New York, New York, Lebanon
    Posts
    1,449
    Thanks
    1
    Thanked 1 Time in 1 Post

    Re: Adding Add-IN programmatically (2002)

    <img src=/S/hello.gif border=0 alt=hello width=25 height=29> Howard

    Go where no VBA Developer has Gone.

    You know it is the brave soldier who goes first into the mine field, all others who follow will have it easier.

    All I ask is you wear your helmet tight, so that we can ask you questions when you are done.

    Best of luck, and we are all behind you.

    Wassim
    <img src=/S/compute.gif border=0 alt=compute width=40 height=20> in the <img src=/S/bagged.gif border=0 alt=bagged width=22 height=22>

  10. #10
    Platinum Lounger
    Join Date
    Feb 2001
    Location
    Weert, Limburg, Netherlands
    Posts
    4,812
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Adding Add-IN programmatically (2002)

    AFAIK the code in the setup file I ship with my Autosafe utility and my Name manager handles this process OK.

    Have a look after downloading it from the Excel MVP page below my sig., the setup code is not protected.
    Note that the Autosafe setup code also disables the Excel Autosave utility. The name manager's setup only handles "itself".
    Jan Karel Pieterse
    Microsoft Excel MVP, WMVP
    www.jkp-ads.com
    Professional Office Developers Association

  11. #11
    Gold Lounger
    Join Date
    Dec 2000
    Location
    New Hampshire, USA
    Posts
    3,386
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Adding Add-IN programmatically (2002)

    It appears that I am doing the same thing.

    I expect that I messed up somehow, or ran into a rouge file handle, when I had the problem.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •