RobBroekhuis
Technical User
Hi all,
I'm trying to write and execute some code for installing the tool I'm writing as an AddIn:
The code executes fine up to the addins.add statement (including a prompt whether to overwrite the existing .xla file, so I know that string variable s contains the proper filename), but then gives me a non-descript error (add method of addins class failed). What am I doing wrong?
Thanks for your help!
Rob
I'm trying to write and execute some code for installing the tool I'm writing as an AddIn:
Code:
Sub InstallAsAddIn()
Dim s As String
If ThisWorkbook.IsAddin Then Exit Sub
s = Application.StartupPath
s = Left(s, Len(s) - 13) + "addins\RC1 toolbox.xla"
ActiveWorkbook.SaveAs s, xlAddIn
Application.AddIns.Add s
Application.AddIns("RC1 toolbox").Installed = True
End Sub
Thanks for your help!
Rob