Iterating unregistered add-ins (.xla)

后端 未结 6 1579
灰色年华
灰色年华 2020-12-31 13:17

I need help in

  • figuring out how to iterate through currently open Excel add-in files (.xla) that have not been registered in Excel using the Too
6条回答
  •  一生所求
    2020-12-31 13:45

    I have had issues with addins that are installed (and in the VBE) not being available via user's Addin on Exel 2013 (in a work environment).

    Tinkering with the solution from Chris C gave a good workaround.

    Dim a As AddIn
    Dim wb As Workbook
    
    On Error Resume Next
    With Application
        .DisplayAlerts = False
            For Each a In .AddIns2
            Debug.Print a.Name, a.Installed
                If LCase(Right$(a.Name, 4)) = ".xla" Or LCase(Right$(a.Name, 5)) Like ".xla*" Then
                    Set wb = Nothing
                    Set wb = .Workbooks(a.Name)
                    wb.Close False
                    Set wb = .Workbooks.Open(a.FullName)
                End If
            Next
       .DisplayAlerts = True
    End With
    

提交回复
热议问题