none
Where to store Excel .xla addin referenced by workbook that may be used in multiple office versions and windows versions RRS feed

  • Question

  • I have an Excel VBA addin  (CIPSO Tools.xla)  that is referenced by a workbook (RecordAnalyzer) and another addin (Toolbox).  The CIPSO Tools addin has no user interface and is opened when the Toolbox addin or the RecordAnalyzer workbook is opened.  The RecordAnalyzer can be created by one person and sent to many others as long as all have the addin on their computer. I have had the CIPSO Tools addin stored in C:\Program Files\CIPSO\CIPSO Tools for about ten years and it has worked fine until Windows 7 came along and created two Program Files folders.  At this point users with Window XP would get an error when opening a Record analyzer created on a Windows 7 computer because the CIPSO Tools addin was stored under C:\Progam Files (x86) instead of C:\Program Files and RecordAnalyzer couldn't find the reference.

    I also have a simple setup.exe that copies the CIPSO Tools.xla to the CIPSO Tools folder, copies the Toolbox addin to the Office addins folder and installs it as an Excel addin, and copies the RecordAnalyzer template to the Office templates folder.  With Windows 7 the setup.exe is not able to create or copy to the C:\Program Files\CIPSO\CIPSO Tools folder even when user is an administartor on the computer.

    Where can I store the CIPSO Tools Addin where it will be accessable by all and be able to be copied via my simple .exe for initial setup and updates?  I tried C:\CIPSO\CIPSO Tools for storing the CIPSO Tools addin and had no problems creating folder and copying to it with my simple .exe.

    Wednesday, July 10, 2013 10:35 AM

All replies

  • Hi David,

    Welcome.

    I'm trying to involve some senior engineers into the issue. It takes some time. Your patience will be greatly appreciated.

    Thanks for your understanding and have a nice day.


    Yoyo Jiang[MSFT]
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Friday, July 12, 2013 6:25 AM
    Moderator
  • Hi David,

    Based on my understanding of your description, you are looking for a function to identify you add-in location (Program Files or Program Files(x86)).

    If so, here is a sample which could reference “*.xla” file successfully on 32-bit/64-bit version Windows.

    Sub InstallAddIn()
        Const PROGRAM_FILES = &H26&
        Dim objShell As Object
        Dim objFolder As Object
        Dim addInPath As String
        Dim addIn As addIn
        
        Set objShell = CreateObject("Shell.Application")
        
        Set objFolder = objShell.Namespace(PROGRAM_FILES)
        
        addInPath = objFolder.self.Path & "\CIPSO\CIPSO Tools\Tools.xla"
        
        Set addIn = Application.AddIns.Add(addInPath)
        
        addIn.Installed = True
    End Sub
    

    Tuesday, July 16, 2013 8:34 AM
    Moderator