delete module

M

mike allen

I am having trouble deleting modules. I am used to this working, even
though it looks like I am deleting worksheets and not modules. It does not
work, however, on new program/computer, for some reason:
Sheets(Array("module2", "module3")).Delete

These 2 do not work either:
Modules(Array("module2", "module3")).Delete
WorkSheets(Array("module2", "module3")).Delete

I have tried Chip Pearson's routine, but couldn't get it to work, either.
"Programmatic access to Visual Basic Project is not trusted" is what I get.

Does anyone know of a way to simply delete modules? Thanks, Mike Allen
 
B

Bob Phillips

You need at least to grant programmatic access to delete modules

Tools>Macro>Security and on the Trusted Publishers tab, tick the Trust
access to Visual Basic project checkbox. Then follow the instructions on
Chip's site.

--
---
HTH

Bob

(change the xxxx to gmail if mailing direct)
 

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