Results 1 to 13 of 13

Thread: Solved: Can't get my XLA auto installer to work...

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #8
    VBAX Contributor
    Joined
    Jun 2007
    Posts
    150
    Location
    Ok, so i figured it all out... you are correct, one line that I changed doomed me...

    I combined the Reinstall/Install together: basically I added the lines to remove old code before installation. I wrapped them in a "On Error resume next" set of code, like I usually do when deleting files that may not be there.

    'uninstall any previous versions
    On Error Resume Next
    Workbooks(RF_AI_FName & ".xla").Close False
    AddIns(RF_AI_Title).Installed = False
    Kill (Application.UserLibraryPath & RF_AI_FName & ".xla")
    On Error GoTo 0


    The line that caused all the problems : AddIns(RF_AI_Title).Installed = False
    This line is totally unnecessary, the old AddIn is removed just fine by simply closing it and killing the file.

    For whatever reason, having that line in there made the macro crash when it tried to .installed = true for the final AddIn install... UNLESS there is an open, visible workbook. Yes its true, I doubted it myself when I got up this morning, but I tested it pretty extensively. Adding and later removing a dummy workbook makes the code run fine.

    So, I have two solutions:
    1. Delete the unnecessary code line.
    2. Add a few lines to add and remove a useless workbook.

    I went with option 1.

    Thanks for the help, guys.
    Last edited by Bob Phillips; 01-14-2022 at 07:33 AM. Reason: Updated code tags

Posting Permissions

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