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)
CODE 2 (paste into a standard module)
CODE 3 I am using some functions in other modules. Just copy below into a module in the same project.
Bookmarks