+ Reply to Thread
Results 1 to 2 of 2

Install Add-In by double clicking on file name

  1. #1
    Valued Forum Contributor
    Join Date
    08-29-2012
    Location
    In lockdown
    MS-Off Ver
    Excel 2010 (2003 to 2016 but 2010 for choice)
    Posts
    1,766

    Lightbulb Install Add-In by double clicking on file name

    Hello All,

    I would like to create code for add-ins to simplify the installation process for end users.

    All the end user needs to do/know is double click on the XLM/XLAM in their Windows folder . It will then silently copy itself to a target location, install in add-ins library and auto open. (For the point of this exercise, assume that end users already have macro security set to allow all macros and/or I have already explained that they need to enable macros after double-clicking/opening the excel file)

    I was thinking of code called at workbook_open that would check if the add-in is already installed and in the target location (I prefer the Application.UserLibraryPath). Otherwise, it will save a copy of the workbook in the target location, install the copy from the target location and then close ThisWorkbook (to prevent two copies of the same add-in open).

    This is what I have so far (code below). However I am currently getting an error message "out of stack space" in the macro "AddIn_Open" on the line "ThisWorkbook.SaveCopyAs". Why?

    CODE #1 (goes in ThisWorkbook module)
    Please Login or Register  to view this content.
    CODE 2 (paste into a standard module)
    Please Login or Register  to view this content.
    CODE 3 I am using some functions in other modules. Just copy below into a module in the same project.
    Please Login or Register  to view this content.
    *******************************************************

    HELP WANTED! (Links to Forum threads)
    Trying to create reusable code for Custom Events at Workbook (not Application) level

    *******************************************************

  2. #2
    Valued Forum Contributor
    Join Date
    08-29-2012
    Location
    In lockdown
    MS-Off Ver
    Excel 2010 (2003 to 2016 but 2010 for choice)
    Posts
    1,766

    Re: Install Add-In by double clicking on file name

    The attached workbook is the code in post1.

    After downloading, you will need to open the workbook and save it as an add-in (to test it properly - please don't save it in your application.userlibrarypath).
    Then - While the add-in isn't stored in your userlibrarypath and isn't installed - browse to the folder containing the XLM/XLAM and double click on it.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1