Iterating unregistered add-ins (.xla)

后端 未结 6 1578
灰色年华
灰色年华 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:46

    As of Office 2010, there is a new collection .AddIns2 which is the same as .AddIns but also includes the unregistered .XLA plug-ins.

    Dim a As AddIn
    Dim w As Workbook
    
    On Error Resume Next
    With Application
        For Each a In .AddIns2
            If LCase(Right(a.name, 4)) = ".xla" Then
                Set w = Nothing
                Set w = .Workbooks(a.name)
                If w Is Nothing Then
                    Set w = .Workbooks.Open(a.FullName)
                End If
            End If
        Next
    End With
    

提交回复
热议问题