Removing a module using VBA

P

PCLIVE

I'm pretty sure this can be done as I have been able to remove code from
ThisWorkbook.

How can I use VBA code to remove a module...say..."Module1".

Thanks in advanced.
Paul
 
B

Bernie Deitrick

Sub RemoveModule()
With ActiveWorkbook.VBProject
.VBComponents.Remove .VBComponents("Module1")
End With
End Sub

Of course, this requires a reference to the MS VBA extensibility...


HTH,
Bernie
MS Excel MVP
 
B

Bob Phillips

No of course about it, it doesn't.

--
---
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)
 

Ask a Question

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.

Ask a Question

Top