View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
JohnDing JohnDing is offline
external usenet poster
 
Posts: 5
Default How to create a "xla" add-ins and active it.

I disigned several user-defined function and I'd like it
could be automatically installed to others PC, so I need
the function to create a "xla" file and use Addins
("abc").installed=True to active it. but I failed. below
is my codes, pls help to diagnose.

'--------------------------------
Sub LoadXLA()
Dim AddInPath As String
Const xlaFile As String = "abc.xla"
AddInPath = "C:\Documents and Settings\user\Application
Data\Microsoft\AddIns\"
If Dir(AddInPath & xlaFile) = "" Then
WB.SaveAs AddInPath & xlaFile, FileFormat:=xlAddIn
End If
AddIns("abc").Installed = True
End Sub
'--------------------------------