+ Reply to Thread
Results 1 to 3 of 3

can't update a master add-in!

Hybrid View

  1. #1
    Forum Contributor
    Join Date
    06-14-2010
    Location
    Toronto,Canada
    MS-Off Ver
    Excel 2003
    Posts
    145

    can't update a master add-in!

    Hi,
    I have never worked with add-in before and I am having problems. I am using a master add-in to reference code for over 100 files. I know how to install the add-in and it's reference by VBA. But when I update the code in master add-in (which btw gives a pop-up "xxx.xla is already open" when I open it), all other files reference the old add-in and are not updated by master add-in. Below is my WorkbookOpen event code: What am I doing wrong?
       On Error Resume Next
        'add the add-in
        If AddIns("Cclmodules_Tel").Installed = False Then
           AddIns.Add("\\cadd-ntsrv00\cadd-drv\Shared_Files\Cable Material Catalogue\CCLModules_TEL.xla", True).Installed = True
        End If
        
        'add the add-in reference
        Dim i As Integer, refExists As Boolean
        refExists = False
        For i = 1 To ThisWorkbook.VBProject.References.Count
            If ThisWorkbook.VBProject.References(i).Name = "TELModules" Then
                refExists = True
                Exit For
            End If
        Next i
        If Not refExists Then ActiveWorkbook.VBProject.References.AddFromFile Environ("AppData") & "\Microsoft\AddIns\CCLModules_TEL.xla"
    
    '    Application.Run "CCLModules_Tel.xla!WorkbookOpenEvent"
        
    '    if an error other than  32813 appeared means there is a problem, add that library manually
        If Err <> 0 And Err <> 32813 Then
            MsgBox "One or more VBA Object libraries not loaded properly." & vbCrLf _
                    & "Error " & Err.Number & ": " & Err.Description
        End If
    Last edited by adds007; 04-18-2011 at 09:00 AM.

  2. #2
    Forum Contributor
    Join Date
    06-14-2010
    Location
    Toronto,Canada
    MS-Off Ver
    Excel 2003
    Posts
    145

    Re: can't update a master add-in!

    Ok, I did some research and figured I update you guys with some more info.
    I read upon forums and realized that:
    1) in VBA, add-in has to uninstalled
    2) close excel
    3) deleted from Application Data folder
    4) open excel
    5) in VBA, install the add-in again by file from shared drive of the more updated version

    I don't understand how I am supposed to do all this in VBA. I mean how can I delete file while Excel is closed from VBA. Below code doesn;t work
        If AddIns("Cclmodules_Tel").Installed = True Then
            AddIns("Cclmodules_Tel").Installed = False
            Kill Environ("AppData") & "\Microsoft\AddIns\CCLModules_TEL.xla"   '<---Permission denied error here
        End If
        AddIns.add("\\cadd-ntsrv00\cadd-drv\Shared_Files\Cable Material Catalogue\CCLModules_TEL.xla", True).Installed = True
    How do i update my add-in code to all computers referencing it?

  3. #3
    Forum Contributor
    Join Date
    06-14-2010
    Location
    Toronto,Canada
    MS-Off Ver
    Excel 2003
    Posts
    145

    Re: can't update a master add-in!

    I didn't find an efficient solution for this, so i decided let all the file reference the same add-in on a shared network space
    Thanks for viewing

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1