Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Delete a module in VBA?
I use an Excel template with a lot of modules to produce a particular type
of report and when I have completed the workbook, I send it to others but do not wish to include all the VBA modules. Therefore, in VBA, I manually delete each module. Is there a way to do this in VBA code? Anybody got any good suggestions? Look forward to response Philip |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Delete a module in VBA?
Phillip,
See www.cpearson.com/excel/vbe.htm for detail about working with VBProject objects and code with code. -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com "Philip Reece-Heal" wrote in message . .. I use an Excel template with a lot of modules to produce a particular type of report and when I have completed the workbook, I send it to others but do not wish to include all the VBA modules. Therefore, in VBA, I manually delete each module. Is there a way to do this in VBA code? Anybody got any good suggestions? Look forward to response Philip |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Delete a module in VBA?
From Chip
Deleting A Module From A Workbook The procedure below will delete the module named "NewModule" from ThisWorkbook. Sub DeleteModule() Dim VBComp As VBComponent Set VBComp = ThisWorkbook.VBProject.VBComponents("NewModule") ThisWorkbook.VBProject.VBComponents.Remove VBComp End Sub You cannot delete the ThisWorkbook code module, or a sheet code module, or a chart code module. -- Don Guillett SalesAid Software "Philip Reece-Heal" wrote in message . .. I use an Excel template with a lot of modules to produce a particular type of report and when I have completed the workbook, I send it to others but do not wish to include all the VBA modules. Therefore, in VBA, I manually delete each module. Is there a way to do this in VBA code? Anybody got any good suggestions? Look forward to response Philip |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
code to delete module / macro in another file | Excel Discussion (Misc queries) | |||
Delete macro that is not in a module | Excel Discussion (Misc queries) | |||
code in module A to not execute a Worksheet_SelectionChange sub of another module | Excel Discussion (Misc queries) | |||
Delete a module | Excel Discussion (Misc queries) | |||
Delete userform/module using VB | Excel Programming |