Sub DeleteUserForms()
' 1. need to check "Microsoft Visual Basic For Applications
' Extensibility 5.3" at VBE menu Tools | References
' 2. need to check next "Trust access to Visual Basic Project"
' at Excel menu Tools | Macro | Security | Trusted Sources
Dim VBComp As VBIDE.VBComponent
Dim VBComps As VBIDE.VBComponents
Set VBComps = ThisWorkbook.VBProject.VBComponents
For Each VBComp In VBComps
If VBComp.Type = vbext_ct_MSForm Then VBComps.Remove VBComp
Next VBComp
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.