This is driving me nuts...
I'm trying to set up an auto-installer for my XLA file. I'm basing it on the code listed in this article:
vbaexpress.com/forum/showthread.php?t=10855
Its two pieces, a data workbook as XLS and a macro workbook as XLA. I'll be distributing it as an XLS, so built into the workbook open event is a check for file extension... it is .XLS, it runs the AddInInstaller() sub.
Here is the relevant code:
Application.EnableEvents = False
AddIns.Add(AddInFname).Installed = True
Application.EnableEvents = True
Which produces this error:
Run-time error '1004':
Unable to get the Add property of the AddIns class
I've tried EVERYTHING! Using different forms of the file name, using different locations, using ThisworkBook.FullName, none of it works!
I also tried changing the code a little, to separate the steps:
Application.EnableEvents = False
AddIns.Add (AddInFname)
AddIns(AddInTitle).Installed = True
Application.EnableEvents = True
This produces a slightly different error:
Run-time error '1004':
Add method of Addins class failed
I even tried throwing out my code and pasting in the code from the article verbatim: same error, on the same piece of code.
AddIns.Add(ThisWorkbook.FullName, True) _
.Installed = True
Please help, I'm pulling my damn hair out.