Hello, Experts!
I'm trying to write a macro to save my workbook as an .xla Add In. I can do it manually and I have recorded the macro so I can see what the code should be but I just can't get it work.
I'm using Excel 2003 on XP and here's my code so far:
Can anybody help me?
I'm trying to write a macro to save my workbook as an .xla Add In. I can do it manually and I have recorded the macro so I can see what the code should be but I just can't get it work.
I'm using Excel 2003 on XP and here's my code so far:
Code:
Dim WBName As String
Dim AI as Excel.AddIn
ThisWorkbook.Save
ThisWorkbook.IsAddin = True
WBName = Application.UserLibraryPath & "\MyFunctions.xla"
Application.ActiveWorkbook.SaveAs Filename:=WBName, FileFormat:=xlAddIn
Set AI = Application.AddIns.Add(Filename:=WBName)
AI.Installed = True
Can anybody help me?