Can anyone please provide a script that will delete all userforms in all open workbooks except for the workbook it is being run from, it can not be a code that needs to be pasted into a reference via Alt T, it needs to be able to be run as a macro in a userform.
I was provided the following code but it cliches on this line.
code:
For Each VBComp In VBProj.VBComponents
full code follows
code:
Sub RemoveAllUserForms()
Dim VBComp As Object
Dim VBProj As Object
For Each VBProj In Application.VBE.VBProjects
For Each VBComp In VBProj.VBComponents
If VBComp.Type = 3 Then
VBProj.VBComponents.Remove VBComp
End If
Next VBComp
Next VBProj
End Sub
I was provided the following code but it cliches on this line.
code:
For Each VBComp In VBProj.VBComponents
full code follows
code:
Sub RemoveAllUserForms()
Dim VBComp As Object
Dim VBProj As Object
For Each VBProj In Application.VBE.VBProjects
For Each VBComp In VBProj.VBComponents
If VBComp.Type = 3 Then
VBProj.VBComponents.Remove VBComp
End If
Next VBComp
Next VBProj
End Sub