This will remove all modules. You cannot remove Sheet or Thisworkbook
modules.
Dim VBComp As Object
Dim vbMod As Object
For Each vbMod In ThisWorkbook.VBProject.vbcomponents
If vbMod.Type = 1 Then ' a module
ThisWorkbook.VBProject.vbcomponents.remove vbMod
End If
Next vbMod
--
HTH
RP
(remove nothere from the email address if mailing direct)
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.