Removing modules and forms

Joined
Apr 12, 2007
Messages
2
Reaction score
0
I have these lines of code in my procedure to remove forms and modules.

For Each vbMod In ThisWorkbook.VBProject.VBComponents
ThisWorkbook.VBProject.VBComponents.Remove vbMod
Next vbMod

But I get this error:
Programmatic access to Visual Basic Project is not trusted

Can anyone tell me how to get around this?

Thanks in advance
Daniel
 
Back
Top