我想要一个VBA代码,用于卸载以字母U开头的所有加载项。
像
这样的东西Application.Addins("U%").Installed = False.
答案 0 :(得分:2)
使用循环以及您从其他问题中了解的其他解决方案:
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