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
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