Вопрос

I want a VBA code which uninstalls all the add-ins starting with the letter U.

Something like

Application.Addins("U%").Installed = False.
Это было полезно?

Решение

Use loop and the other solution which you know from the other question of yours:

Sub Addin_start_with_U()

    On Error Resume Next

    Dim tmpAddIn As AddIn
    For Each tmpAddIn In Application.AddIns
        'optionally we write add-in name to immediate
        Debug.Print tmpAddIn.Name

        'add-in name could start with 'u' or 'U'- both will be unistalled:
        If UCase(Left(tmpAddIn.Name, 1)) = "U" Then
            tmpAddIn.Installed = False
        End If
    Next

    On Error GoTo 0
End Sub
Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top