is it possible to remove modules from a closed workbook ?
I've a lot of workbooks where i want to remove a module.
is it possible to remove modules from a closed workbook ?
I've a lot of workbooks where i want to remove a module.
Just must open each workbook.
You can have a macro open each workbook in a folder, delete the module, then save and close the workbook.
Are the projects in these workbooks password protected?
What is the module that you want to remove?
Hi,
Small sample you could use:
Sub DeleteCodeModule() With Application .ScreenUpdating = False .Workbooks.Open ("C:\index.xls") With .ActiveWorkbook .VBProject.VBComponents.Remove .VBProject.VBComponents("Module2") .Save .Close End With .ScreenUpdating = True End With End Sub
In 2000 this will run without problems in version greater then 2000 you need to check "Trust access to vbproject" on the second tab of macro security settings.
Otherwise it won't allow you to perform this action to the VBE.
_________
Groetjes,
Joost Verdaasdonk
M.O.S. Master
Mark your thread solved, when it has been, by hitting the Thread Tools dropdown at the top of the thread.
(I don't answer questions asked through E-mail or PM's)