When i write this example I supposed
that it's unknown where is the macro
resides and code of example provide way to delete the concrete macro.
You can remove the whole module if it is empty with the following
lines of code:
if loVBProject.VBComponents("here_must_be_name_of module").CodeModule.CountOfLines<1
loVBProject.VBComponents.Remove(loVBProject.VBComponents("here_must_be_name_of module"))
endif
"here_must_be_name_of module" may be "Module1" etc.
if you have a question - don't hesitate to ask :)
>OK, I am getting somewhere! All the three macro sub()'s are being deleted (yea). However, the module that held the macros (default is Module1 unless I name it) is left behind. So when the user opens the excel spreadsheet it still gives that Macro Security error dialog (even though there are no individual macros in there). I think if I can delete the module name then all will be right with the world.
>
>Is there a way to delete the module name? Thinking about it, if I can just delete the module, I wonder if all the macros inside will disappear, too?
>
>Thanks in advance, you have been a big help!!!!
>
>Kevin