Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I am trying to write a piece of VBA that takes a copy of a workbook, deletes
various sheets, deletes the module that is attached to the sheet and then e-mails it to a list of recipients. I have managed to acheive everything EXCEPT the deletion of the module. Can anyone give me the code to delete "Module1" from my workbook using VBA. Thanks, Rich |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Sub DeleteModule() Dim VBComp As VBComponent Set VBComp = ThisWorkbook.VBProject.VBComponents("NewModule") ThisWorkbook.VBProject.VBComponents.Remove VBComp End Sub You need to have the Microsoft Visual Basic For Application Extensibility library activated in your references -- ehnt ----------------------------------------------------------------------- ehntd's Profile: http://www.excelforum.com/member.php...fo&userid=1586 View this thread: http://www.excelforum.com/showthread.php?threadid=27515 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
VB Modules | Excel Discussion (Misc queries) | |||
Help with modules. | New Users to Excel | |||
Modules | Excel Programming | |||
modules that run modules | Excel Programming | |||
Class Modules vs Modules | Excel Programming |