VBA TIPS
Installing and Making add-in available

Assume you've made an add-in. But most of users (novices) don't know where the add-in workbook should be placed.
It is difficult for novices to get where the Addin Directory is.
The path for the Addin Directory would be different depends on the version of OS they are using.

Typical Dir locations are
  • C:\Program Files\Microsoft Office\Office\Library
  • C:\WINDOWS\Application Data\Microsoft\AddIns

Since I installed every version of Excel(from Excel 95 to Excel 2003), my Addin Directory is
C:\Program Files\Microsoft Office\Office2003\Library
. Yes I chose custom install.



You may be able to look for the Addin Directory with Application.LibraryPath Property,
For the typing that command in the immediate window, Excel returns the path for the Addin Directory. However, even that work might be difficult for a beginner.

So...why don't you write a program for setting your addin?

I made an example addin for my addin named HtmlMaker light. click here to download and please give it a try. The following is a procedure written in install.xls

Option Explicit


Sub Auto_Open()
    InstallAddIn
End Sub



Sub InstallAddIn()
    'The file name of the add-in
    Const sAddInFullName As String = "HtmlMakerLight1.11.xla"
    'Title of the Add-in
    Const sAddInName As String = "HtMl Maker light ver1.11"
    Dim sAdiPath As String
    Dim sLibPath As String

    'Source path
    sAdiPath = ThisWorkbook.Path & Application.PathSeparator & sAddInFullName

    'Destination path
    sLibPath = Application.LibraryPath & Application.PathSeparator & sAddInFullName

    On Error Resume Next
    'Copy an add-in file to the Liblary folder
    FileCopy Source:=sAdiPath, Destination:=sLibPath

    'Make an add-in available
    With AddIns(sAddInName)
        If Not .Installed Then
            AddIns.Add Filename:=sLibPath
            .Installed = True
        End If
    End With
    On Error GoTo 0


    MsgBox sAddInName & " has been installed"
    ThisWorkbook.Close False
End Sub



To make your own menu in your add-in, you can use Menu Generator. Please have a look at Downloads site.

| HOME |
Copyright © cellmasters.net - colo's junk room All Right Reserved
ABOUT
WORKS
THE CELL MASTERS
CONTACT
LINKS
Tips and Information about Microsoft Excel|Masaru Kaji aka Colo